I get the following error while upgrading a firebase project from old domain to new google firebase domain.
Failed to resolve: com.google.firebase:firebase-core:9.0.0
I followed the steps mentioned on the Firebase documentation, in the section Add Firebase to your Android Project, topic Available libraries.
What are my options to resolve this error?
In my case, on top of adding google() in repositories for the project level gradle file, I had to also include it in the app level gradle file.
Faced myself and seen several times in comments for similar questions - that even after installing "latest" Google Play Services and Google Repository still having the same issue.
The thing is that they may be latest for your current revision of Android SDK Tools, but not that latest your app build requires.
In such case make sure to install latest version of Android SDK Tools first, and probably Android SDK Platform-tools (both under Tools branch). Also please note you may need to go through this several times if you haven't updated for a long time (i.e. install latest Android SDK Tools and Android SDK Platform-tools, then restart Android SDK Manager, then repeat), since the updates seem to be going through some critical mandatory milestones and you cannot install the very latest if you currently have the revision which is pretty "old".
If all the above methods are not working then change
implementation 'com.google.firebase:firebase-core:12.0.0'
toimplementation 'com.google.firebase:firebase-core:10.0.0'
in your app level build.gradle file. This would surely work.Update Aug 2017
As of version
11.2.0
Firebase and Google Play services dependencies are available via Google's Maven Repo. You no longer need to use the Android SDK manager to import these dependencies.In your root
build.gradle
file add the repo:If you are using gradle
4.0
or higher you can replacemaven { url "https://maven.google.com" }
with justgoogle()
.The
9.0.0
version of Firebase was built using Google Play services 9.0 and is now available under the new packagingcom.google.firebase:*
See Release Notes for Google Play services 9.0 https://developers.google.com/android/guides/releases#may_2016_-_v90
New versions of packages Google Play Services (rev 30) and Google Repository (rev 26) were just released in the SDK manager so it's likely you just need to update.
Downloading Google Play Services and Google Repository
From Android Studio:
Tools
>Android
>SDK Manager
.SDK Tools
tab.Google Play Services
(rev 30) andGoogle Repository
(rev 26). See the image below.Sync
andBuild
your project.From IntelliJ IDEA:
As of April 2017, the latest versions of Google Play Services and Repository are listed below.
Tools
>Android
>SDK Manager
.Packages
panel, Look for theExtras
.Google Play Services
(rev 39) andGoogle Repository
(rev 46). See the image below.Perform a gradle project sync
andBuild
your project.Go to Android SDK Manager and install the latest version of below two libraries