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
Related
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.
How to resolve this error!
"Failed to resolve: com.google.firebase:firebase-messaging:16.0.5"
Firebase dependencies version is 16.0.5, I switch and play with some other versions also, still have the error.
def Firebase_version = "16.0.5"
implementation "com.google.firebase:firebase-auth:$Firebase_version"
implementation "com.google.firebase:firebase-messaging:$Firebase_version"
Am using latest version of classpath
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.0.2'
And repositories
google()
jcenter()
Both are added:
Android Studio : 3.2.1
firebase-messaging 16.0.x version seems unavailable, That why we
getting the error
"Failed to resolve: com.google.firebase:firebase-messaging:16.0.5"
In order to fix it keep the other 16.0.x versions as it is
and upgrade 17.x.x versions to the latest
code is given below
def Firebase_Auth_Version = "16.0.5"
def Firebase_Messaging_Version = "17.3.4"
implementation "com.google.firebase:firebase-messaging:$Firebase_Messaging_Version"
implementation "com.google.firebase:firebase-auth:$Firebase_Auth_Version"
To solve this, please change the following lines of code:
implementation "com.google.firebase:firebase-auth:$Firebase_version"
implementation "com.google.firebase:firebase-messaging:$Firebase_version"
to
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
And add:
implementation 'com.google.firebase:firebase-core:16.0.4'
Which is now mandatory in order to make Firebase work.
Disable Gradle offline and re-syncing worked for me.
What actually was missing for me and what made it work was 'Google Play services'
Go to: Settings -> Android SDK -> SDK Tools -> check/install Google Play services.
Hope it helps.
You need to add this dependencies as well.
implementation 'com.google.firebase:firebase-core:16.0.5'
Try by adding above dependencies.
Try this
implementation "com.google.firebase:firebase-messaging:17.3.4"
Try this in the app gradle file:
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-database:16.0.5'
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 am integrating Firebase messaging for a version. It is:
'com.google.firebase:firebase-messaging:15.0.2'
My classpath is:
classpath 'com.google.gms:google-services:3.2.0'
I had faced the following error:
Failed to resolve: firebase-messaging Open File
Change this:
classpath 'com.google.gms:google-services:3.2.0'
implementation 'com.google.firebase:firebase-messaging:15.0.2'
into this:
classpath 'com.google.gms:google-services:4.0.1'
implementation 'com.google.firebase:firebase-messaging:17.0.0'
Explanation:
Here in this case using firebase-messaging:15.0.2 with google-services:4.0.1 would work, since the most important thing was updating google-services above 3.2.0, and that's because google-services:3.3.0 is needed to be able to use the firebase library from version 15.0 and above. You can check this blog post. that explains the changes in versioning of firebase libraries.
But it is still better to update the google-services plugin to prevent any other errors with other dependencies.
Note:
The versions less than 15.0.0 are in google maven repository, so you can use them in gradle. But, you cannot mix version 15.0.0 with a version less than 15.0.0 and use google play services 4.0.1, as said in my answer here. That's why it is better to update firebase libraries to the latest versions.
According to the Guy4444 1 on the post 2 I have changed
implementation 'com.google.firebase:firebase-messaging:17.0.0:15.0.0'
to
implementation 'com.google.firebase:firebase-messaging:17.0.0'
and it solved the problem!
I got it resolved by changing
this
implementation 'com.google.firebase:firebase-messaging:17.0.0:15.0.0'
to this
implementation 'com.google.firebase:firebase-messaging:17.0.0'
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.