I'm using Firebase Crashlytics and Firebase BoM
implementation "com.google.firebase:firebase-bom:26.2.0"
implementation "com.google.firebase:firebase-crashlytics-ktx"
The default configuration works ok, but I need to get access to FirebaseCrashlytics.getInstance()
And here comes the problem. Without setting crashlytics-ktx version it doesn't work.
I have to use
implementation "com.google.firebase:firebase-crashlytics-ktx:17.3.0"
instead of
implementation "com.google.firebase:firebase-crashlytics-ktx"
Any ideas how to resolve this?
Related
I have facing the following error while building the project. And unable to solve the same after trying it for whole day.
error: To use RxJava2 features, you must add `rxjava2` artifact from Room as a dependency. androidx.room:room-rxjava2:<version>
public abstract java.lang.Object clearAllBillers(#org.jetbrains.annotations.NotNull()
^
below are my dependancies inside the build.gradle
implementation("androidx.room:room-rxjava2:2.3.0")
implementation "androidx.room:room-runtime:2.3.0"
implementation "androidx.room:room-ktx:2.3.0"
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
kapt "androidx.room:room-compiler:2.3.0"
I have done trying already existing solutions such as upgrading
classpath 'com.android.tools.build:gradle:7.3.1'
Also tried to do invalidate cache and clean project.
Still not able to solve the issue.
Please help me if you have any idea to get it resolve.
Thanks in advance!!!❤️
Not sure why haven't you received an answer quicker (because this question has an easy solution)
you just need to add
implementation("androidx.room:room-rxjava2:2.4.3")
to your build.gradle (for your app or module)
(source)
Everywhere in my project I see that the annotation #SerializedName is unresolved, even though I import it:
import com.google.gson.annotations.SerializedName
I also have all the necessary build.gradle dependencies:
implementation "com.squareup.retrofit2:retrofit:2.9.0"
implementation "com.squareup.retrofit2:adapter-rxjava2:2.6.2"
implementation "com.squareup.retrofit2:converter-gson:2.9.0"
implementation 'com.google.code.gson:gson:2.8.6'
I've synced project files and rebuilt multiple times, but the annotation keeps getting highlighted in red by Android Studio.
The oddest part is that everything compiles, builds and works perfectly, but having all the red elements makes working on the project difficult, what could I be missing?
Just upgrade to
implementation 'com.google.code.gson:gson:2.8.8'
You can find the latest version on Github releases
retrofit and gson should have same same version to work well
inorder to work well in build.gradle(:app)
implementation 'com.squareup.retrofit2:retrofit:2.9.1'
implementation 'com.google.code.gson:gson:2.9.1'
implementation 'com.squareup.retrofit2:converter-gson:2.9.1'
Currently we have a lot of firebase version.
firebase_core_version = '16.0.6'
firebase_perf_version = '16.2.2'
firebase_messaging_version = '17.3.4'
...
implementation "com.google.firebase:firebase-core:$firebase_core_version"
implementation "com.google.firebase:firebase-perf:$firebase_perf_version"
implementation "com.google.firebase:firebase-messaging:$firebase_messaging_version"
...
But they each have different version number and sometimes they are conflicting or resolved to unexpected versions by transitive includes. Or other module declares different version for same library... That steals my time.
Is there any solutions for this?
Gradle has "BoM" feature that is available from 5.0. and it enables you free from version hell.
implementation platform('com.google.firebase:firebase-bom:20.0.1')
implementation 'com.google.firebase:firebase-perf'
implementation 'com.google.firebase:firebase-messaging'
implementation 'com.google.firebase:firebase-appindexing'
implementation 'com.google.firebase:firebase-config'
You may notice that only new import firebase-bom has version and any other libraries don't have version.
This is because BoM dependency contains all firebase version inside it (of course they are compatible!).
So your module always import firebase-bom then version conflict will be gone.
firebase-bom is currently experimental but it works for me.
https://firebase.google.com/docs/android/setup#firebase-bom
I hope androidx (jetpack) also have this!
There is also okhttp-bom available.
https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp-bom
I use only Firebase Database and I've added only the next dependency:
implementation 'com.google.firebase:firebase-database:16.0.1'
it seems works ok
but during compilation I get next warning
Warning: The app gradle file must have a dependency on
com.google.firebase:firebase-core for Firebase services to work as
intended.
Should I still add Core? like:
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
Yes, you have to explicitly list it now:
Update - June 12, 2018
Your app gradle file now has to explicitly list com.google.firebase:firebase-core as a dependency for Firebase services to work as expected.
more info here:
https://firebase.google.com/support/release-notes/android
I am trying to use several functionalities of Firebase at the same time, which requires several implementations. Namely, cloud storage, database, and authentication. However, when using the Firebase interface in android studio and clicking on "add *** to your app" to add the implementation I'm getting the conflict
"Please fix the version conflict either by updating the version of the google-services"
implementation 'com.github.bumptech.glide:glide:4.0.0'
implementation 'com.google.firebase:firebase-auth:11.6.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
Those are the ones im using ( there is a red line under the auth one and when I hover over it, it says all libraries must use the same Version ...
Any ideas how to solve this ?
change this:
implementation 'com.google.firebase:firebase-auth:11.6.0'
into this:
implementation 'com.google.firebase:firebase-auth:11.8.0'
Ok After some Trial and Errors, I found out that I have to use 11.6.0 on all of them since Auth 11.8.0 Does not exist yet.