Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails, could not resolve all files for configuration ':app:debugCompileClasspath' #755

Closed
zcoffin86 opened this issue Jun 28, 2018 · 12 comments

Comments

@zcoffin86
Copy link

After installing firebase plugin I'm getting this build error. Cordova CLI 8, android platforms tested: 7.1.0, 7.0.0, 6.4.0. After removing firebase plugin build succeeds. Below is terminal log of a test project, but same behavior noticed in pre-existing apps that were working in fact earlier today. I tried adding and changing things in build.gradle buildscript repositories and allprojects repositories but to no avail. TIA

zcoffin@DESKTOP-PUBHRS2 MINGW64 ~/Documents/switchboard (master)
$ cordova create firebasetest
Creating a new cordova project.

zcoffin@DESKTOP-PUBHRS2 MINGW64 ~/Documents/switchboard (master)
$ cd firebasetest

zcoffin@DESKTOP-PUBHRS2 MINGW64 ~/Documents/switchboard/firebasetest (master)
$ cordova plugin add cordova-plugin-firebase
Adding cordova-plugin-firebase to package.json
Saved plugin info for "cordova-plugin-firebase" to config.xml

zcoffin@DESKTOP-PUBHRS2 MINGW64 ~/Documents/switchboard/firebasetest (master)
$ cordova platform add android@7.1.0
Using cordova-fetch for cordova-android@7.1.0
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms\android
Package: io.cordova.hellocordova
Name: HelloCordova
Activity: MainActivity
Android target: android-27
Subproject Path: CordovaLib
Subproject Path: app
Android project created with cordova-android@7.1.0
Android Studio project detected
Android Studio project detected
Installing "cordova-plugin-firebase" for android
Subproject Path: CordovaLib
Subproject Path: app
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Installing "cordova-plugin-whitelist" for android

           This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.

Adding cordova-plugin-whitelist to package.json
Saved plugin info for "cordova-plugin-whitelist" to config.xml
Preparing Firebase on Android
--save flag or autosave detected
Saving android@~7.1.0 into config.xml file ...

zcoffin@DESKTOP-PUBHRS2 MINGW64 ~/Documents/switchboard/firebasetest (master)
$ cordova run android
Android Studio project detected
Preparing Firebase on Android
ANDROID_HOME=C:\Users\zcoffin\AppData\Local\Android\Sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144
studio
:wrapper

BUILD SUCCESSFUL in 2s
1 actionable task: 1 executed
Subproject Path: CordovaLib
Subproject Path: app
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_9xxnqqha5bkaipei78uv1fe7e.run(C:\Users\zcoffin\Documents\switchboard\firebasetest\platforms\android\app\build.gradle:144)
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:compileDebugAidl
:CordovaLib:compileDebugRenderscript
:CordovaLib:checkDebugManifest
:CordovaLib:generateDebugBuildConfig
:CordovaLib:prepareLintJar
:CordovaLib:generateDebugResValues
:CordovaLib:generateDebugResources
:CordovaLib:packageDebugResources
:CordovaLib:platformAttrExtractor
:CordovaLib:processDebugManifest
:CordovaLib:javaPreCompileDebug
:CordovaLib:processDebugJavaRes NO-SOURCE
:app:preBuild UP-TO-DATE
:app:preDebugBuild FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not resolve all files for configuration ':app:debugCompileClasspath'.

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-base.aar (com.google.android.gms:play-services-base:15.0.1).
Searched in the following locations:
https://jcenter.bintray.com/com/google/android/gms/play-services-base/15.0.1/play-services-base-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 8s
11 actionable tasks: 11 executed
(node:19552) 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 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-base.aar (com.google.android.gms:play-services-base:15.0.1).
Searched in the following locations:
https://jcenter.bintray.com/com/google/android/gms/play-services-base/15.0.1/play-services-base-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 8s
at ChildProcess.whenDone (C:\Users\zcoffin\Documents\switchboard\firebasetest\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:961:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
(node:19552) 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:19552) [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.

@zcoffin86
Copy link
Author

zcoffin86 commented Jun 29, 2018

I modified:

allprojects {
    repositories {
        jcenter()

to:

allprojects {
    repositories {
        jcenter { url "http://jcenter.bintray.com/"}

in files:

platforms/android/build.gradle

following some advice from https://forum.ionicframework.com/t/build-fails-on-android-could-not-resolve-all-files-for-configuration/119024 and now it builds. Can someone explain to me what's going on? Is this an issue with Cordova or Gradle or the external repositories or this plugin or ... ?

@wilfredonoyola
Copy link

wilfredonoyola commented Jul 5, 2018

I have same problem,

Did you fix this?

I need to fix this.

MY IONIC INFO:

`
cli packages: (/Users/wilfredonoyola/workspace/statusfy/sf-ionic-1/node_modules)

@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

global packages:

cordova (Cordova CLI) : 8.0.0 

local packages:

@ionic/app-scripts : 3.1.10
Cordova Platforms  : android 7.0.0
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.1.1
ios-deploy        : 1.9.2 
Node              : v6.11.3
npm               : 3.10.10 
OS                : macOS High Sierra
Xcode             : Xcode 9.4.1 Build version 9F2000 

Environment Variables:

ANDROID_HOME : /Users/wilfredonoyola/Library/Android/sdk/

Misc:

backend : pro`

@zcoffin86
Copy link
Author

See my comment above. It seems that jcenter might have different packages available on http vs https. I have no idea why.

@MoisesValera
Copy link

@zcoffin86 thank you so much for this, i had the same error using this plugin and cordova-plugin-firebase-authentication and your solution fixed it for both plugins

@zcoffin86
Copy link
Author

You could also simply put maven before jcenter, then as long as the package is in maven gradle won't bother checking jcenter.

@soumak77
Copy link
Contributor

closing as resolved

@ajithofficial
Copy link

{ url "http://jcenter.bintray.com/"}

it's working good in normal build. But i have error -

Execution failed for task ':app:lintVitalRelease'.

Could not resolve all artifacts for configuration ':app:debugAndroidTestRuntimeClasspath'.
Could not find livedata-core.aar (android.arch.lifecycle:livedata-core:1.1.0).
Searched in the following locations:
http://jcenter.bintray.com/android/arch/lifecycle/livedata-core/1.1.0/livedata-core-1.1.0.aar
Could not find common.jar (android.arch.lifecycle:common:1.1.0).
Searched in the following locations:
http://jcenter.bintray.com/android/arch/lifecycle/common/1.1.0/common-1.1.0.jar
Could not find runtime.aar (android.arch.core:runtime:1.1.0).
Searched in the following locations:
http://jcenter.bintray.com/android/arch/core/runtime/1.1.0/runtime-1.1.0.aar
Could not find common.jar (android.arch.core:common:1.1.0).
Searched in the following locations:
http://jcenter.bintray.com/android/arch/core/common/1.1.0/common-1.1.0.jar
Could not find viewmodel.aar (android.arch.lifecycle:viewmodel:1.1.0).
Searched in the following locations:
http://jcenter.bintray.com/android/arch/lifecycle/viewmodel/1.1.0/viewmodel-1.1.0.aar
---with release build please help 👍

@prvn1992
Copy link

prvn1992 commented Nov 2, 2018

if @zcoffin86 solution doesn't work, try this: https://stackoverflow.com/a/50565175/5576333

@zcoffin86
Copy link
Author

I wonder if using platform android 7.1.1 would fix?

@Esom
Copy link

Esom commented Nov 27, 2018

thanks..

if @zcoffin86 solution doesn't work, try this: https://stackoverflow.com/a/50565175/5576333

thanks

@zcoffin86
Copy link
Author

@Esom that's what we ended up doing for a while, but cordova platform android 7.1.x seemed to have solved this, at least on all of our dev machines. 3rd party integrations are another matter!

sagrawal31 added a commit to wizpanda/cordova-plugin-firebase-lib that referenced this issue Apr 3, 2019
@ryanmtaylor
Copy link

the best solution for me has been cordova plugin add https://github.com/wizpanda/cordova-plugin-firebase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants