Why am I getting this error? My repository and Google play services are up to date and I've used all the requires steps for using Firebase like copying firebase code in both build.gradle(Project and app). The intellisence doesn't even show FirebaseAuth but displays other members of Firebase.
Solved the error by adding this to the build.gradle file(for app) -
implementation 'com.google.firebase:firebase-auth:18.0.0'
implementation 'com.google.android.gms:play-services-gcm:17.0.0'
The 2nd dependency is to solve the version conflict error.
Add this dependency to Gradle.Build(Module:App)
compile "com.google.firebase:firebase-auth:9.0.2"
then sync with gradle :)
Add these two dependencies into your build.gradle
as 'compile' is replaced by 'implementation'
dependencies {
implementation 'com.google.firebase:firebase-auth:16.0.4'
implementation "com.google.android.gms:play-services-gcm:16.0.0"
}
***For the latest android studio version 3.0 and new ones ***
Same problem. Clean your project with "Build"->"Clean Project".
add the following to the build.gradle (app)
implementation 'com.google.firebase:firebase-auth:9.2.1'
For me this worked with all the firebase extensions:
eg.:
Android studio adds the following line to your gradle file:
implementation 'com.google.firebase:firebase-auth:16.0.1:15.0.0'
You have to change it to:
implementation 'com.google.firebase:firebase-auth:16.0.1'
and add:
kapt 'com.google.firebase:firebase-auth:16.0.1:15.0.0'
I have android studio 3.3.1 installed. Compile is replaced with implementation. So you have to write
implementation 'com.google.firebase:firebase-auth:16.1.0'
You should replace version according to the warning you get.
on dependencies in app gradle
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.1'
this is useful android 3.0 and onwards versions auth:16.0.1 and
core:16.0.1Firebase will work
Solved the error by adding this to the build.gradle file(for app) -
compile 'com.google.firebase:firebase-auth:9.2.1'
compile "com.google.android.gms:play-services-gcm:9.2.1"
You may need to make sure that your activity is importing the Firebase Auth module. In your .java file (eg. Login.java):
import com.google.firebase.auth.FirebaseAuth;
Please add the below line in your build.gradle file:
implementation 'com.google.firebase:firebase-auth:19.3.0'
implementation "com.google.android.gms:play-services-gcm:10.2.1"
In my case, I was using firebase-auth and firebase-messaging with different versions. So After getting an error I kept the same version for both e.g.
implementation 'com.google.firebase:firebase-auth:18.0.0'
implementation 'com.google.firebase:firebase-messaging:18.0.0'
After sync, my problem was solved. try to keep the version the same for firebase libraries
implementation 'com.google.firebase:firebase-auth:16.0.1'
make sure your firebase and all the dependency are the same versions.
Related
Just started this error on Android build. Please help.
"Duplicate class com.google.android.gms.internal.firebase_messaging.zza found in modules jetified-firebase-iid-19.0.0-runtime.jar (com.google.firebase:firebase-iid:19.0.0) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)"
In build.gradle:
implementation "com.google.firebase:firebase-iid:21.1.0"
None of the answers above is correct. And none of them solves the problem.
The problem is in transitive dependencies.
You need to check which libs are causing the issue and do something like:
implementation 'com.google.firebase:firebase-messaging:22.0.0'
implementation ('com.google.firebase:firebase-iid:21.1.0') {
transitive = true
}
I resolved this problem by using the Firebase Android BoM
In my case the problem depends on the coexistence of messaging and functions.
So from this:
implementation 'com.google.firebase:firebase-messaging:22.0.0'
implementation 'com.google.firebase:firebase-functions-ktx:20.0.0'
To this:
implementation platform('com.google.firebase:firebase-bom:28.2.1')
implementation 'com.google.firebase:firebase-functions-ktx'
implementation 'com.google.firebase:firebase-messaging'
BOM 31.x does have currently this problem.
See issue here:
https://github.com/firebase/firebase-android-sdk/issues/4206
Resolved via issue here but not yet official released:
https://github.com/firebase/firebase-android-sdk/pull/4225
Comment:
it was not resolved yet, 31.0.1 only contained a fix to crashlytics crash bug. That's why this issue is still open. The team here will make a fix close the issue, then do a release likely with release notes indicating it is fixed, when it is fixed https://firebase.google.com/support/release-notes/android - here
A current workaround is to add the iid version explicitly until a new BOM version is released:
implementation platform('com.google.firebase:firebase-bom:31.0.0')
implementation 'com.google.firebase:firebase-functions'
implementation 'com.google.firebase:firebase-messaging'
implementation 'com.google.firebase:firebase-iid:21.1.0'
I encountered the same problem.
I fixed it by redefining my dependencies implementations like this:
In build.gradle:
implementation 'com.google.firebase:firebase-analytics:19.0.0'
implementation 'com.google.firebase:firebase-auth:17.0.0'
implementation 'com.google.firebase:firebase-messaging:22.0.0'
Please note my configuration in buildscript: com.android.tools.build:gradle:4.2.1
Then, clean and rebuild project.
Can you share more information about your setup?
Using react-native-push-notification ^3.1.9, I've got the same error.
To fix it :
in project/build.gradle:
buildscript {
ext {
googlePlayServicesVersion = "17.0.0"
firebaseMessagingVersion = "20.1.0"
firebaseVersion = "20.1.0"
// other settings
}
// other settings
}
in project/app/build.gradle:
dependencies {
implementation "com.google.firebase:firebase-messaging:20.1.0"
// other implementations
}
The reason : react-native-push-notification package specify dependency to firebase-messaging:+ : which ask to get the last version.
So, gradle upload the latest com.google.firebase:firebase-messaging:22.x.x which declare already existing classes in firebase-iid.
If you don't want to use firebase-bom because you don't trust firebase to keep all the proper versions in check then you can remove the duplicate.
Run ./gradlew app:dependencies (or replace app with your module)
Search for iid:19.0.0 (or whatever version is giving you issues)
Scroll up in the list to see where the library originates from.
You should see something like \--- com.google.firebase:firebase-iid:19.0.0
Keep scrolling until you find the dependency and module it originates in, marked with a + eg (+--- com.google.firebase:firebase-ml-vision)
Locate the dependency in your project and remove the duplicate iid
api("com.google.firebase:firebase-ml-vision:$version") {
exclude group: 'com.google.firebase', module: 'firebase-iid'
}
I'm trying to update my firebase id & firebase messaging version but it gives me error
implementation "com.google.firebase:firebase-core:17.0.0"
implementation "com.google.firebase:firebase-iid:17.0.2"
implementation "com.google.firebase:firebase-messaging:17.0.0"
implementation "com.google.android.gms:play-services-places:17.0.0"
implementation "com.google.android.gms:play-services-location:17.0.0"
implementation "com.google.android.gms:play-services-maps:17.0.0"
Dependency failing: com.google.firebase:firebase-messaging:17.0.0 -> com.google.firebase:firebase-iid#[16.0.0], but fire
base-iid version was 19.0.0.
Also giving following errors:
The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
ifact with the issue.
-- Project 'mifosng' depends on project 'debugCompileClasspath' which depends onto com.google.firebase:firebase-analytic
s#17.0.0
-- Project 'mifosng' depends on project 'debugCompileClasspath' which depends onto com.google.firebase:firebase-core#17.
0.0
-- Project 'mifosng' depends on project 'debugCompileClasspath' which depends onto com.google.firebase:firebase-messagin
g#17.0.0
This happened to me before, You need to add/enable AndroidX in your project
Do not forget to add these in your Project properties:
android.useAndroidX=true
android.enableJetifier=true
This work for me :
implementation 'com.google.firebase:firebase-iid:19.0.1'
implementation 'com.google.firebase:firebase-core:17.0.1'
implementation 'com.google.firebase:firebase-database:18.0.0'
implementation 'com.google.firebase:firebase-auth:18.1.0'
implementation 'com.google.firebase:firebase-messaging:19.0.1'
And
classpath 'com.google.gms:google-services:4.3.0'
in dependencies of the top level build.gradle
You dont need to add:
implementation "com.google.firebase:firebase-iid:17.0.2"
As it is a transitive dependency used in firebase-messaging which means firebase-messaging already uses it. So just remove implementation "com.google.firebase:firebase-iid:17.0.2" from your build.gradle file.
I am new to android development environment and I need to connect my app to firebase but I am getting this error
Failed to resolve: firebase-auth-15.0.0
This error is shown in the statement:
implementation 'com.google.firebase:firebase-auth:16.0.1:15.0.0'
This statement contain details of two versions, I think the error is caused due to this, but this particular statement is provided by firebase itself. See the image:
I tried to change the above statement to
implementation 'com.google.firebase:firebase-auth:16.0.3'
But then firebase dependency is not setting up.
implementation 'com.google.firebase:firebase-auth:16.0.1:15.0.0'
Replace the above one with
implementation 'com.google.firebase:firebase-auth:16.0.1'
Instead of:
implementation 'com.google.firebase:firebase-auth:16.0.1:15.0.0'
Insert these two lines:
implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'com.google.firebase:firebase-core:16.0.6'
Warnings should disappear
Try to use only implementation 'com.google.firebase:firebase-auth:16.0.1' in your code.
In your root build.gradle file add the repo:
allprojects {
repositories {
google()
jcenter()
// ...
}
}
Check if your firebase core is the same version than your firebase auth
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.google.firebase:firebase-auth:16.0.3'
and in your classpath an up version of 3.0.0
classpath 'com.android.tools.build:gradle:3.0.1' //up of this version
check this page to be up to date with firebase version:
https://firebase.google.com/support/release-notes/android#latest_sdk_versions
Try This add the dependency for Authentication to your app-level build.gradle file
implementation 'com.google.firebase:firebase-auth:16.0.3'
Worked with me, follow me.
I had this same problem. In the implementation of dependencies they are with the implementation 'com.google.firebase: firebase-auth: 16.0.2' ". The first is usually implemented manually and the second when we click the add button authentication with Firebase by the console in Android Studio and that is where the error begins. This button does not need to be triggered to authenticate the app. Just the first button to Connect with Firebase.
In the build.gradle file, keep only one Auth dependency.
Add firebase-core dependency and the latest versions of dependencies from this page:
fire base libraries
implementation 'com.google.firebase:firebase-auth:16.0.1:15.0.0'`
Replace the above with this -->
implementation 'com.google.firebase:firebase-auth:16.0.1'
I had the same problem. I updated the Android Studio and the Gradle ,it seems to work fine now
When I connect to Firebase Auth I got error in dependencies check this screen shot. How to fix this error?
You need to override the clashing support libraries by adding the conflicted libraries explicitly in your dependencies block.
dependencies {
implementation "com.android.support:support-media-compat:28.0.0"
implementation "com.android.support:animated-vector-drawable:28.0.0"
}
or you can use the whole support-v4 library which is include all the above libraries:
dependencies {
implementation "com.android.support:support-v4:28.0.0"
}
The message is self explanatory, you are using different versions for each of the following.
implementation 'com.android.support:support-media-compat:26.1.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
Change any one to match another, usually upgrading is better choice.
I have upgraded the version of Glide from 4.0.0-RC0 to 4.4.0. But it is giving me an error saying
Error:Module 'com.github.bumptech.glide:glide:4.4.0' depends on one or more Android Libraries but is a jar
It is not saying which jar or any other information.
Does anybody know how to fix this? I am also attaching the entries for Glide in my build.gradle
compile 'com.github.bumptech.glide:glide:4.4.0'
compile 'com.github.bumptech.glide:okhttp3-integration:4.4.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'
compile 'com.github.bumptech.glide:annotations:4.4.0'
EDIT : I am using the support library version 27.0.1
I faced the same issue, but using this solved it :
compile('com.github.bumptech.glide:glide:4.4.0#aar') {
transitive = true;
}
To pull in the annotations module which contains #GlideModule, you have to use transitive = true
This is may be glide issue so, I will prefer to don't update glide to com.github.bumptech.glide:glide:4.4.0 till now. you can use older version like com.github.bumptech.glide:glide:4.3.1 or com.github.bumptech.glide:glide:4.3.0 or com.github.bumptech.glide:glide:4.2.0
you can read more about these issues on
issue 2318
issue 2319
Just use this in app.gradle and you are done :
compile 'com.github.bumptech.glide:glide:3.7.0'
Just need to do these steps to avoid this error:
1 - update your sdk version to 27
2 - In your dependencies in build.gradle:
implementation('com.github.bumptech.glide:glide:4.6.1') {
exclude group: "com.android.support"
}
And you are good to go as this one resolved my issue.
implementation 'com.github.bumptech.glide:glide:4.0.0-RC0'
Once check with this dependencies for latest android studio 3.0.2 this dependencies build proper gradle.
You can use it like this in your build. Simply:
dependencies {
implementation 'com.github.bumptech.glide:glide:4.4.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'
}