Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to resolve: com.google.firebase:firebase-core:15.0.0

I have a strange issue when integrate firebase:

enter image description here

like image 774
user9646810 Avatar asked Apr 14 '18 20:04

user9646810


3 Answers

if you integrate firebase automatically from tools, The new version of android studio have strange bug, the software inserts

    implementation 'com.google.firebase:firebase-database:16.0.1:15.0.0'

instead of

    implementation 'com.google.firebase:firebase-database:16.0.1'

fix this line (remove numbers after last ':')

enter image description here

like image 136
Guy4444 Avatar answered Sep 24 '22 15:09

Guy4444


Remove the

implementation 'com.google.firebase:firebase-database:16.0.1:15.0.0'

and add only

implementation 'com.google.firebase:firebase-database:16.0.1'

Because 16.0.1 is added by our self and while after that we connect firebase using the plugin in the studio, it adds a new lib file with 15.0.0. So that's not required.

like image 28
Subin Babu Avatar answered Sep 22 '22 15:09

Subin Babu


Step 1 :

In your root build.gradle file add the repo:

allprojects {
  repositories {
   google()
   maven { url "https://maven.google.com" }
 }
}

Now Sync Gradle. This is the directory that contains the repos of Firebase.

Step 2 :(if step 1 doesn't works)

If the Step 1 doesn't works, then it should be because you are using the Gradle in offline mode. If your gradle is set to offline, android studio searches for the cached copies of the dependencies that you want to update and throws an error since it hasn't downloaded the file before.

Go to Settings >> Build, Execution, Deployment >> Gradle.
In the Global Gradle Settings section, disable Offline mode.

Now Sync Gradle again.

like image 30
Febin Mathew Avatar answered Sep 24 '22 15:09

Febin Mathew