I am trying to begin with FirestorePagingAdapter and FirestorePagingOptions
and I read the documentation carefully like here
https://github.com/firebase/FirebaseUI-Android/tree/master/firestore
and applied it by step by step
1-
implementation 'android.arch.paging:runtime:1.x.x'
2- Query baseQuery = mItemsCollection.orderBy("value", Query.Direction.ASCENDING);
But when I am trying to add FirestorePagingOptionsit appears by the red line code that means it is not imported or implemented well and I am not using any android architecture models. After a lot of searches, I found nothing clear about it
So what is the right way to begin with FirestorePagingAdapter ? what I should implement to begin with?
this is my implementation
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.google.firebase:firebase-core:16.0.3'
//google sign inj
implementation 'com.google.android.gms:play-services-auth:15.0.0'
implementation 'com.google.firebase:firebase-firestore:15.0.0'
implementation 'com.google.firebase:firebase-auth:15.0.0'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.google.firebase:firebase-messaging:17.3.0'
implementation 'com.google.firebase:firebase-storage:15.0.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.firebaseui:firebase-ui-firestore:3.3.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
//FIREBASE UI LIBRARY
implementation 'android.arch.lifecycle:runtime:1.1.1'
implementation 'android.arch.lifecycle:extensions:1.1.1'
implementation 'android.arch.paging:runtime:1.0.1'
implementation 'android.arch.core:runtime:1.1.1'
implementation 'android.arch.core:common:1.1.1'
implementation 'android.arch.lifecycle:common-java8:1.1.1'
May be it's too late to answer. I reached to this page as I faced exactly the same issue.
Adding implementation 'com.firebaseui:firebase-ui-firestore:4.3.2' to the gradle dependencies solved this issue.
Related
I have following firebase libraries:
implementation platform('com.google.firebase:firebase-bom:26.8.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-config'
implementation 'com.google.firebase:firebase-core'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-inappmessaging-display'
implementation 'com.google.firebase:firebase-messaging'
implementation 'com.google.firebase:firebase-perf'
after I upgrade them to 27.0.0
implementation platform('com.google.firebase:firebase-bom:27.0.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-config'
implementation 'com.google.firebase:firebase-core'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-inappmessaging-display'
implementation 'com.google.firebase:firebase-messaging'
implementation 'com.google.firebase:firebase-perf'
This library disapper:
com.google.androind.gsm:play-services-base:17.0.0#aar
Which brakes following import:
import com.google.android.gms.common.GoogleApiAvailability
Any idea how to fix this properly?
I solved it by adding manually this version:
implementation 'com.google.android.gms:play-services-base:17.3.0'
I hope it is correct version, because 'com.google.android.gms:play-services-basement' was also 17.3.0 which has dependecy from 'com.google.firebase:firebase-bom'.
But this solution is not nice, because I have to check if I use correct version after each BOM update, which makes BOM idea (use all compatible libraries by itself) pretty useless.
It is also strange, that last available version is com.google.android.gms:play-services-base:17.6.0.
After upgrading Microsoft Graph dependency in my project from implementation 'com.microsoft.graph:microsoft-graph:2.10.0' to implementation 'com.microsoft.graph:microsoft-graph:3.0.0' the compilation fails with following error:
Duplicate class javax.activation.ActivationDataFlavor found in modules jetified-activation-1.1 (javax.activation:activation:1.1) and jetified-jakarta.activation-api-1.2.1 (jakarta.activation:jakarta.activation-api:1.2.1)
Duplicate class javax.activation.CommandInfo found in modules jetified-activation-1.1 (javax.activation:activation:1.1) and jetified-jakarta.activation-api-1.2.1 (jakarta.activation:jakarta.activation-api:1.2.1)
...
Duplicate class javax.activation.UnsupportedDataTypeException found in modules jetified-activation-1.1 (javax.activation:activation:1.1) and jetified-jakarta.activation-api-1.2.1 (jakarta.activation:jakarta.activation-api:1.2.1)
Have any of you seen this before, and how do I fix this behaviour ?
Anyone knows if the changes in v3.0.0 are so severe that they can`t coexist with this dependency scheme ?
dependencies {
implementation platform('com.google.firebase:firebase-bom:26.1.0')
implementation 'com.google.firebase:firebase-crashlytics-ktx'
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-perf-ktx'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.3'
implementation 'androidx.core:core-ktx:1.5.0-beta03'
implementation 'androidx.appcompat:appcompat:1.3.0-beta01'
implementation 'androidx.camera:camera-camera2:1.1.0-alpha02'
implementation 'androidx.camera:camera-lifecycle:1.1.0-alpha02'
implementation 'androidx.camera:camera-view:1.0.0-alpha22'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0-beta01'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.4'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.4'
implementation 'androidx.fragment:fragment-ktx:1.3.1'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.room:room-runtime:2.3.0-beta03'
kapt 'androidx.room:room-compiler:2.3.0-beta03'
implementation 'androidx.room:room-testing:2.3.0-beta03'
implementation 'androidx.room:room-ktx:2.3.0-beta03'
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0-alpha01'
implementation 'androidx.recyclerview:recyclerview:1.2.0-beta02'
implementation ('com.microsoft.identity.client:msal:2.0.8')
{exclude group: 'com.microsoft.device.display'}
implementation ('com.microsoft.graph:microsoft-graph:3.0.0')
implementation 'com.google.android.material:material:1.4.0-alpha01'
//Guava, to avoid conflict on ListenableFuture on jetified-guava-20.0 (com.google.guava:guava:20.0)
// and jetified-listenablefuture-1.0 (com.google.guava.listenablefuture:1.0)
// https://stackoverflow.com/questions/56639529/duplicate-class-com-google-common-util-concurrent-listenablefuture-found-in-modu
implementation 'com.google.guava:guava:30.1-jre'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.maps.android:android-maps-utils:2.2.0'
implementation 'com.google.android.gms:play-services-location:18.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.2'
implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.2'
}
Actually this version change is breaking, and here is the migration guide:
https://www.github.com/microsoftgraph/msgraph-sdk-java/tree/dev/docs%2Fupgrade-to-v3.md
But you might also add some exclusions in your packaging option in build.gradle (:app) like:
packagingOptions{
exclude("META-INF/INDEX.LIST")
exclude("META-INF/AL2.0")
exclude("META-INF/LGPL2.1")
exclude("META-INF/LICENSE.md")
exclude("META-INF/NOTICE.md")
exclude("META-INF/io.netty.versions.properties")
}
You might need add some more...
I need to use a different set of firebase libraries in the project. But I'm getting the following error :
Unable to resolve dependency for ':#debug/compileClasspath': Could not resolve com.android.support:support-v13:28.0.0.
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.google.android.gms:play-services-plus:17.0.0'
implementation 'com.google.firebase:firebase-core:17.0.0'
implementation 'com.google.firebase:firebase-auth:18.0.0'
implementation 'com.google.firebase:firebase-messaging:19.0.0'
// Add dependency
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'com.google.firebase:firebase-iid:19.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.facebook.android:facebook-android-sdk:4.34.0'
implementation 'com.google.firebase:firebase-crash:16.2.1'
If you want to use the latest versions, then you can use firebase BoM, in the build.gradle, write the following:
dependencies {
// Import the platform
implementation platform('com.google.firebase:firebase-bom:20.0.1')
// When using a BoM, dependencies don't require a specified version
// If you do specify a version, it overrides the library version specified in the BoM
implementation 'com.google.firebase:firebase-core'
implementation 'com.google.firebase:firebase-auth'
implementation 'com.google.firebase:firebase-firestore'
}
com.google.firebase:firebase-bom:20.0.1 will contain the latest version of all firebase libraries, then to use each specific library you add them as you normally do but without a version.
References:
https://firebase.google.com/docs/android/setup#firebase-bom
I know looks like some stupid error, but I cannot find it.
In my project I have access to LifecycleOwner from my Fragments but not from Activity.
Here is my build.gradle
implementation project(':domain')
implementation project(':data')
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.1'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.core:core-ktx:1.1.0-alpha05'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
// Koin for Android
implementation "org.koin:koin-android:$koin_version"
implementation "org.koin:koin-androidx-viewmodel:$koin_version"
// Anko
implementation "org.jetbrains.anko:anko-commons:$anko_version"
implementation "org.jetbrains.anko:anko-sdk15-listeners:$anko_version"
//Architecture components
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
Here is the Activity code:
And this is the source code of AppCompatActivity
As per this issue, this is a known issue if you use core-ktx:1.1.0 and appcompat:1.0.2, mixing alpha versions with stable releases. Upgrade to appcompat:1.1.0-alpha03 to fix the issue:
implementation 'androidx.appcompat:appcompat:1.1.0-alpha03'
It's your core library. Also general rule of thumb for production code, try to avoid using alpha. Update the following libraries and you should be fine.
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.1'
Can not Resolved FirebaseOptions.Builder().setCredentials() i have referred to answers in this link but it did not solve my problem.
here's my code:
FileInputStream serviceAccount =
new FileInputStream("./ServiceAccountKey.json");
FirebaseOptions options = new FirebaseOptions.Builder()
.setCredentials(GoogleCredentials.fromStream(serviceAccount))
.setDatabaseUrl("https://imiocr-f4522.firebaseio.com")
.build();
FirebaseApp.initializeApp(options);
FirebaseApp.initializeApp(options);
String customToken = FirebaseAuth.getInstance().createCustomTokenAsync("3mLImCwhyddkVZ9PWWNlw34pFVR2").get();
this is my app gradle file dependencies:
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.+'
implementation 'com.wang.avi:library:2.1.3'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-database:16.0.4'
implementation 'com.firebase:firebase-client-android:2.5.2'
implementation 'com.firebaseui:firebase-ui-database:4.2.0'
implementation 'com.intuit.ssp:ssp-android:1.0.6'
implementation 'com.google.firebase:firebase-storage:16.0.4'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'me.dm7.barcodescanner:zxing:1.9.8'
implementation 'com.android.support:design:28.0.0-alpha1'
//implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.github.bumptech.glide:glide:4.7.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
implementation 'com.firebaseui:firebase-ui-storage:4.1.0'
//implementation 'com.google.firebase:firebase-admin:6.2.0'
setCredentials method is never recognized, please help.
You seem to be trying to use both the Admin SDK and the regular Android SDK for Firebase in the same app. This is not a supported scenario.
The Admin SDK is specifically meant for use on servers, and other trusted environments. Using in Android apps that you share with your users opens your Firebase project up to abuse.
If you need some functionality in your app that is not available in the Android SDK, but is possible through the Admin SDK, consider wrapping that functionality in Cloud Functions, and calling that from your Android app. That way you can control what specific functionality you make available, instead of giving them full access to your Firebase project.