Nativescript-plugin-firebase: Could not find com.google.firebase:firebase-core:9.0.0. After attempting to build for Android.

Created on 15 Aug 2016  路  11Comments  路  Source: EddyVerbruggen/nativescript-plugin-firebase

I've followed the Docs to install the firebase plugin. I have installed the newest versions of the Google Play Services (rev 32) and Google Repository (rev 32) through the SDK Manager.

My TNS version is 2.2.1 and tns-android is 2.2.0

In ~/platforms/android/build.gradle I have:

    dependencies {
        classpath "com.android.tools.build:gradle:2.1.2"
        classpath "com.google.gms:google-services:3.0.0"
    }

Along with this at the bottom of the file:
apply plugin: "com.google.gms.google-services"

The platforms directory also contains my google-services.json file. Yet when ever I run 'tns build android' I get the below error, Any guidance would be greatly appreciated.:

Could not resolve all dependencies for configuration ':_F0F1F2F3F4DebugCompile'.
Could not find com.google.firebase:firebase-core:9.0.0.
Searched in the following locations:
https://jcenter.bintray.com/com/google/firebase/firebase-core/9.0.0/firebase-core-9.0.0.pom
https://jcenter.bintray.com/com/google/firebase/firebase-core/9.0.0/firebase-core-9.0.0.jar
file:/Users/stevenstratis/Documents/Developer/CareGiver/platforms/android/libs/aar/firebase-core-9.0.0.jar
file:/Users/stevenstratis/Documents/Developer/CareGiver/platforms/android/libs/aar/firebase-core.jar
file:/usr/local/opt/android-sdk/extras/android/m2repository/com/google/firebase/firebase-core/9.0.0/firebase-core-9.0.0.pom
file:/usr/local/opt/android-sdk/extras/android/m2repository/com/google/firebase/firebase-core/9.0.0/firebase-core-9.0.0.jar
Required by:
:CareGiver:unspecified

Most helpful comment

I got this same error and it turned out that I had two Android SDK directories. The one I was updating from Android Studio was not reflected in the ANDROID_HOME folder as set in ~/.profile on my Mac. Worked fine after I fixed this.

All 11 comments

@spstratis Repeat the same step again but this time run tns run android, see if that helps

@kamranarshad Doesn't that run a build step as well?

@spstratis I had this same problem. Turns out I needed the updated version of Google Play Services and Google Repository installed in the Android SDK Manager.

In Android SDK Manager:

  • Click into the SDK Tools tab
  • Select and install Google Play Services (rev 30+) and Google Repository (rev 26+).
  • Sync and Build your project.

Source: Stack Overflow

Same issue. I have all the latest Play Services and Google repository. Any other ideas?

I got this same error and it turned out that I had two Android SDK directories. The one I was updating from Android Studio was not reflected in the ANDROID_HOME folder as set in ~/.profile on my Mac. Worked fine after I fixed this.

God bless you - I am now able to build as well. I had two folders, now the correct one is listed under ANDROID_HOME env variable.

On Windows - Android studio put it a long time ago under C:\Users\ [My-User-Name] \AppData\Local\Android\Sdk

Thanks, I had the same issue - ANDROID_HOME pointing to wrong directory.

Great job on helping each other out guys! Can I persuade one of you to send a PR to update the known Android issues in the readme?

I am also facing the same issue. In my SDK manager the versions are:
Google Play Services: 33
Google Repository: 36

and for the same problem i found one link of same problem
[http://stackoverflow.com/questions/39707382/failed-to-resolve-com-google-firebasefirebase-core9-2-1]
so whats the solution to my problem, and how to revert the google repo to < rev 35 ??
My errors are:

> Could not find any version that matches com.google.firebase:firebase-core:9 .6.+. Versions that do not match: 9.4.0 9.2.1 9.2.0 9.0.2 9.0.1 + 1 more Searched in the following locations: https://jcenter.bintray.com/com/google/firebase/firebase-core/maven-met adata.xml https://jcenter.bintray.com/com/google/firebase/firebase-core/ file:/G:/FireBase/MyApp/platforms/android/libs/aar/ https://repo1.maven.org/maven2/com/google/firebase/firebase-core/maven- metadata.xml https://repo1.maven.org/maven2/com/google/firebase/firebase-core/ file:/C:/Program Files (x86)/Android/android-sdk/extras/android/m2repos itory/com/google/firebase/firebase-core/maven-metadata.xml file:/C:/Program Files (x86)/Android/android-sdk/extras/android/m2repos itory/com/google/firebase/firebase-core/ file:/C:/Program Files (x86)/Android/android-sdk/extras/google/m2reposi tory/com/google/firebase/firebase-core/maven-metadata.xml Required by: :MyApp:unspecified

@sarvagayatri 9.6.1 is the latest version and part of Google Repository 36. The error says the latest version it can find is 9.4.0 so it looks like the SDK manager saves its dependencies in a different folder. Can you hover over the Google Repository in the SDK manager (see screenshot) to figure out the path? Then take a look and see if 9.6.x is there. Then compare that path with the paths you pasted as part of your stacktrace..

screen shot 2016-10-16 at 10 24 34

wow, thx, its worked. actaully the installed folder and the stacktrace showing folder are different. thX

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thunder413 picture thunder413  路  3Comments

dopefatimah picture dopefatimah  路  3Comments

bunower picture bunower  路  3Comments

NickIliev picture NickIliev  路  3Comments

phatakrajan picture phatakrajan  路  4Comments