failed to resolve: com.google.firebase:firebase-database:10.2.0
I am creating a new project and trying to implement some features from googles Fire base dependencies such as compile ‘com.google.firebase:firebase-database:10.2.0, classpath ‘com.google.gms:google-services:3.0.0’ ‘ and sync my project with them. When trying to do so, I get this error:
Error:(25, 13) Failed to resolve: com.google.firebase:firebase-database:10.2.0 <a href="openFile:M:/Downloads/CommunicationApp/app/build.gradle">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>
and also this error:
Error:Failed to resolve: com.google.firebase:firebase-core:10.2.0 <a href="openFile:M:/Downloads/CommunicationApp/app/build.gradle">Open File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>
If anyone knows a solution for me, many thanks!
3 Solutions collect form web for “failed to resolve: com.google.firebase:firebase-database:10.2.0”
I faced the same issue when I tried to use firebase-messaging:10.2.0 and to fix that I did this:
- On Android studio, go to the menu bar and click on Tools > Android > SDK Manager.
- Click on the SDK Tools tab
- check the Google Play services box as well as the Google Repository box.
- Click on apply, it will prompt you before applying the new updates.
- Click Ok and wait for the download
- Sync your project again and everything is fine.
Note: All com.google.android.gms libraries must use the exact same version specification (mixing versions can lead to runtime crashes). If you already have an existing dependency of google play services upgrade it to the same version as firebase.
compile 'com.google.android.gms:play-services:10.2.0' compile 'com.google.firebase:firebase-database:10.2.0'
Hope that helps!
Try to update Google Repository in Android SDKs Manager, and then re-sync gradle
Update Google Play services and Google Repository in SDK Manager.