I used the firebase tool available in android studio to sync my app with firebase database. After connecting to firebase, I had to add realtime database. Sync failed and the following error showed.:
Failed to resolve: firebase-database-15.0.0
The line:
implementation 'com.android.support:appcompat-v7:28.0.0'
Has red underline and when I hover the mouse over it, it shows all android.support libraries must have same exact version specification.
The sync is failing, although I am using the assistant to add the dependencies Why is it so?
I searched on google where it said to change :
implementation 'com.google.firebase:firebase-database:16.0.1:15.0.0'
to :
implementation 'com.google.firebase:firebase-database:16.0.1'
But doing so removes the database from the app.The dependencies are:
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.3'
testImplementation 'junit:junit:4.12'
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-database:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1:15.0.0'
}
i had faced the same issue before .If their is the update available then update your android it will fix it.
from my experience when i use the assistant to add the dependencies then it comes like this
implementation 'com.google.firebase:firebase-database:16.0.1:15.0.0' but the it is not correct update it with this
implementation 'com.google.firebase:firebase-database:16.0.1' or
implementation 'com.google.firebase:firebase-database:15.0.0' or this
maybe this will help you
Related
Tried to add Firebase UI implementation
implementation 'com.firebaseui:firebase-ui-database:6.2.0'
in build.gradle file.
The following error was shown.
*ERROR: Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.firebaseui:firebase-ui-database:6.2.0.
Affected Modules: app*
Please guide me how to resolve the issue.
I am using Android Studio 3.5.3
Other dependencies I have already implemented in the app
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-database:16.0.4'
You need to update the following dependencies:
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-database:16.0.4'
to
implementation 'com.google.firebase:firebase-auth:19.2.0'
implementation 'com.google.firebase:firebase-database:19.2.0
Also upgrade to androidX. Check the following for more information:
From the docs:
FirebaseUI version 6.0.0 has no breaking API changes from version 5.1.0 but updates critical dependencies to new major versions.
There are two major groups of changes:
Convert all Android Support Library dependencies to AndroidX or Jetpack dependencies. For information on migrating to AndroidX see this guide.
Update all Firebase and Google Play services dependencies to their latest major versions. For information on changes included in these SDKs visit the release notes.
You can follow these steps:
Press F4 to open Module settings
Select Dependency
Click Add new dependency
Type firebase, search for firebase.ui and add its latest dependency.
At last I was able to sync successfully without Error.
The final dependencies in the build.gradle file of the app.
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.material:material:1.2.0-alpha03'
implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha01'
implementation 'com.google.firebase:firebase-auth:19.2.0'
implementation 'com.google.firebase:firebase-database:19.2.0'
implementation 'com.firebaseui:firebase-ui-database:6.2.0'
I am really fed up of these stupid android studio errors, the thing is I have included the implementation com.google.firebase:firebase-core:16.1.0 dependency in my build.gradle file but still am getting the error that says :::
Could not find com.google.firebase:firebase-core:16.1.0.
Also if I try to change it from 16.1.0 to 16.0.1 still error continues. How to fix this issue I have built almost 80% of my app and now when I just created new activity it is showing this error, I also deleted the activity but still issue continues. What is the fix for this? Thanks in advance!!
classpath 'com.google.gms:google-services:4.0.1'
And here is my 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.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.github.ittianyu:BottomNavigationViewEx:2.0.2'
implementation 'me.anwarshahriar:calligrapher:1.0'
implementation 'com.firebaseui:firebase-ui-database:4.3.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'com.google.firebase:firebase-core:16.1.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
}
Could not find com.google.firebase:firebase-core:16.1.0"
It happens because firebase-core:16.1.0 doesn't exist (today).
You can check the latest version here. Currently it is 16.0.7
Firebase Core com.google.firebase:firebase-core:16.0.7
Change your dependency in:
implementation 'com.google.firebase:firebase-core:16.0.7'
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.3'
implementation 'com.firebase:firebase-client-android:2.5.2+'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.android.volley:volley:1.1.0'
testImplementation 'junit:junit:4.12'
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-auth:16.0.1:15.0.0'
}
I don't know but the error only shows the appcompat 28.0.0 won't work.
Change
this, implementation 'com.google.firebase:firebase-auth:16.0.1:15.0.0'
to this, implementation 'com.google.firebase:firebase-auth:16.0.1'
and better, update all dependencies to the latest versions
The following dependency is put in by the Firebase Assistant to "Add Firebase Authentication to the App"
implementation 'com.google.firebase:firebase-auth:16.0.1:15.0.0'
If you remove 15.0.0, and make it
implementation 'com.google.firebase:firebase-auth:16.0.1'
that automatically removes Firebase Authentication in the Firebase Assistant, beating the whole purpose. Also if you change to the '...firebase-auth:16.0.1:15.0.0' to the latest version '...firebase-auth:16.1.0:15.0.0', nothing happens to the error, as it is due to the '15.0.0' part.
This is probably a blocker bug from Firebase or Google side, which could be only corrected by them. Hope this catches their attention soon. Otherwise all new developments using this version of Firebase Auth or Database will be stalled. Older versions may be working though.
This question already has answers here:
Dependancy error when integrating android studio project with Firebase for a google sign in feature
(4 answers)
Closed 4 years ago.
I want to connect my app of Android Studio to Firebase but I am getting this error:
Failed to resolve: firebase-auth-15.0.0
This is my current screen:
Is there anything wrong here?
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.3'
testImplementation 'junit:junit:4.12'
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-auth:16.0.1:15.0.0'
}
I have tried cleaning the project and run it again. It didn't make a change.
I have tried removing
implementation 'com.google.firebase:firebase-auth:16.0.1:15.0.0'
and changing it for:
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.firebase:firebase-auth:16.0.3'
with the three of them separately the error goes away, but the Firebase dependency is not setting up.
Try to add this instead of using a lower version.
implementation 'com.google.firebase:firebase-auth:16.0.5'
For more you can follow this: https://firebase.google.com/support/guides/firebase-android
I use the latest version of Android Studio 3.2 & Plugin. When I try to connect firebase it show me to add dependencies -implementation 'com.google.firebase:firebase-auth:16.0.3:15.0.0' for Firebase authentication | implementation 'com.google.firebase:firebase-database:16.0.1:15.0.0' for Realtime Database | implementation 'com.google.firebase:firebase-storage:16.0.1:15.0.0' for Cloud Storage
When using these dependencies it connect Firebase properly but Sync Failed. How to Use these dependencies?
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
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.3'
implementation 'com.google.firebase:firebase-auth:16.0.3:15.0.0'
implementation 'com.google.firebase:firebase-database:16.0.1:15.0.0'
implementation 'com.google.firebase:firebase-storage:16.0.1:15.0.0'
}
apply plugin: 'com.google.gms.google-services'
I had faced the same issue before. If there is the update available then update your android it will fix it. from my experience when I use the assistant to add the dependencies then it comes like this
implementation 'com.google.firebase:firebase-database:16.0.1:15.0.0'
but the it is not correct update it with this
implementation 'com.google.firebase:firebase-database:16.0.1'
or
implementation 'com.google.firebase:firebase-database:15.0.0'
or this
maybe this will help you
here is official documentation for help
Update you firebase dependencies like this:
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-storage:16.0.1'
Basically, remove the last ":15.0.0" part. You probably copied these from the firebase website and made a mistake while pasting