Cordova-plugin-firebase: BUILD FAILED cordova-plugin-firebase

Created on 12 Jun 2018  路  10Comments  路  Source: arnesson/cordova-plugin-firebase

OS:Windows 10
cordova -v
8.0.0
platforms:
android 7.1.0
plugins:
cordova-plugin-firebase 1.0.5 "Google Firebase Plugin"
cordova-plugin-whitelist 1.3.3 "Whitelist"

cordova build

publishNonDefault is deprecated and has no effect anymore. All variants are now published.
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_kowko86ippwtyk3z2ccqnlj1.run(C:appplatformsandroidappbuild.gradle:144)

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not resolve all files for configuration ':app:debugCompileClasspath'.
    > Could not find firebase-analytics.aar (com.google.firebase:firebase-analytics:16.0.0).
    Searched in the following locations:
    https://jcenter.bintray.com/com/google/firebase/firebase-analytics/16.0.0/firebase-analytics-16.0.0.aar
    > Could not find firebase-iid.aar (com.google.firebase:firebase-iid:16.0.0). Searched in the following locations:
    https://jcenter.bintray.com/com/google/firebase/firebase-iid/16.0.0/firebase-iid-16.0.0.aar
    > Could not find play-services-phenotype.aar (com.google.android.gms:play-services-phenotype:15.0.1).
    Searched in the following locations:
    https://jcenter.bintray.com/com/google/android/gms/play-services-phenotype/15.0.1/play-services-phenotype-15.0.1.aar
    > Could not find play-services-tasks.aar (com.google.android.gms:play-services-tasks:15.0.1).
    Searched in the following locations:
    https://jcenter.bintray.com/com/google/android/gms/play-services-tasks/15.0.1/play-services-tasks-15.0.1.aar
    > Could not find play-services-basement.aar (com.google.android.gms:play-services-basement:15.0.1).
    Searched in the following locations:
    https://jcenter.bintray.com/com/google/android/gms/play-services-basement/15.0.1/play-services-basement-15.0.1.aar
  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. 14 actionable tasks: 1 executed, 13 up-to-date

  • Get more help at https://help.gradle.org

BUILD FAILED in 3s
(node:60612) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

  • What went wrong:
    Could not resolve all files for configuration ':app:debugCompileClasspath'.
    > Could not find firebase-analytics.aar (com.google.firebase:firebase-analytics:16.0.0).
    Searched in the following locations:
    https://jcenter.bintray.com/com/google/firebase/firebase-analytics/16.0.0/firebase-analytics-16.0.0.aar > Could not find firebase-iid.aar (com.google.firebase:firebase-iid:16.0.0).
    Searched in the following locations:
    https://jcenter.bintray.com/com/google/firebase/firebase-iid/16.0.0/firebase-iid-16.0.0.aar
    > Could not find play-services-phenotype.aar (com.google.android.gms:play-services-phenotype:15.0.1).
    Searched in the following locations:
    https://jcenter.bintray.com/com/google/android/gms/play-services-phenotype/15.0.1/play-services-phenotype-15.0.1.aar
    > Could not find play-services-tasks.aar (com.google.android.gms:play-services-tasks:15.0.1). Searched in the following locations:
    https://jcenter.bintray.com/com/google/android/gms/play-services-tasks/15.0.1/play-services-tasks-15.0.1.aar
    > Could not find play-services-basement.aar (com.google.android.gms:play-services-basement:15.0.1).
    Searched in the following locations:
    https://jcenter.bintray.com/com/google/android/gms/play-services-basement/15.0.1/play-services-basement-15.0.1.aar * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    * Get more help at https://help.gradle.org

BUILD FAILED in 3s
at ChildProcess.whenDone (C:appplatformsandroidcordovanode_modulescordova-commonsrcsuperspawn.js:169:23)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
(node:60612) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:60612) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Most helpful comment

Check your gradle.build file in platforms/android and add google() before the other repos if it isn't there yet, you're file should look like this:

buildscript {
repositories {
google()
jcenter()
}
}

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

All 10 comments

I had to change the firebase version back to 15.+ instead of +

I had to remove all google services including firebase to make it work. And coincidentally its working without the firebase plugin. 馃挴

I am also having this problem. I don't understand comments regarding version 15 or removing firebase plugin.

Same issue here

Check your gradle.build file in platforms/android and add google() before the other repos if it isn't there yet, you're file should look like this:

buildscript {
repositories {
google()
jcenter()
}
}

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

@LucasMenchi
Thx u,Love u
It works for me!
It works for me!
It works for me!

my file 'platformsandroidbuild.gradle'

code like that

`buildscript {
repositories {
google()
jcenter()
maven {
url "https://maven.google.com"
}
}

// Switch the Android Gradle plugin version requirement depending on the
// installed version of Gradle. This dependency is documented at
// http://tools.android.com/tech-docs/new-build-system/version-compatibility
// and https://issues.apache.org/jira/browse/CB-8143
dependencies {
    classpath 'com.android.tools.build:gradle:3.0.0'
}

}

// Allow plugins to declare Maven dependencies via build-extras.gradle.
allprojects {
repositories {
google()
jcenter()
maven {
url "https://maven.google.com"
}
}
}`

Hello, with this change, continue the error. Only commented the google () line and it work, but I think isn't the correct way.

// Allow plugins to declare Maven dependencies via build-extras.gradle.
allprojects {
repositories {
//google()
maven {
url "https://maven.google.com"
}
jcenter()
}
}

Any suggestion ? Thanks

@hvallenilla You might try commenting out the maven.google.com reference as google() resolves to that. Might be an issue with declaring the same repo twice..

While the solution above does indeed fix the problem, I don't want to have to modify an auto-generated file. Is there a way to force the system to generate build.gradle with the repositories listed in the desired order?

I'm using
cordova 7.1.0
cordova-android 6.4.0
cordova-firebase-plugin 0.1.25

I'm having same Error while adding Cordova-plugin-firebase with ionic. Did there any resolution?
Build file '/Users/abc/Workspace/myApp/platforms/android/build.gradle' line: 46

    * What went wrong:
    A problem occurred evaluating root project 'android'.
    > Could not find method google() for arguments [] on repository container.

I'm using
Cordova - 7.0.1
ionic - 3.10.3
"cordova-plugin-firebase": "^2.0.5"
"@ionic-native/firebase": "^4.19.0"

Was this page helpful?
0 / 5 - 0 ratings

Related issues

michaelreiser picture michaelreiser  路  5Comments

DanielAccorsi picture DanielAccorsi  路  3Comments

rlz picture rlz  路  4Comments

rolinger picture rolinger  路  5Comments

chrissterling picture chrissterling  路  3Comments