Excuse me, and I tried to build an APK with the command
ionic cordova build android --debug
FAILURE: Build failed with an exception.
What went wrong: Could not resolve all files for configuration ':app:debugCompileClasspath'.
Could not find play-services-auth.aar (com.google.android.gms:play-services-auth:11.8.0). Searched in the following locations: https://jcenter.bintray.com/com/google/android/gms/play-services-auth/11.8.0/play-services-auth-11.8.0.aar Could not find play-services-identity.aar (com.google.android.gms:play-services-identity:11.8.0). Searched in the following locations: https://jcenter.bintray.com/com/google/android/gms/play-services-identity/11.8.0/play-services-identity-11.8.0.aar Could not find play-services-auth-api-phone.aar (com.google.android.gms:play-services-auth-api-phone:11.8.0). Searched in the following locations: https://jcenter.bintray.com/com/google/android/gms/play-services-auth-api-phone/11.8.0/play-services-auth-api-phone-11.8.0.aar Could not find play-services-auth-base.aar (com.google.android.gms:play-services-auth-base:11.8.0). Searched in the following locations: https://jcenter.bintray.com/com/google/android/gms/play-services-auth-base/11.8.0/play-services-auth-base-11.8.0.aar Could not find play-services-identity-license.aar (com.google.android.gms:play-services-identity-license:11.8.0). Searched in the following locations: https://jcenter.bintray.com/com/google/android/gms/play-services-identity-license/11.8.0/play-services-identity-license-11.8.0.aar Could not find play-services-auth-api-phone-license.aar (com.google.android.gms:play-services-auth-api-phone-license:11.8.0). Searched in the following locations: https://jcenter.bintray.com/com/google/android/gms/play-services-auth-api-phone-license/11.8.0/play-services-auth-api-phone-license-11.8.0.aar Could not find play-services-auth-base-license.aar (com.google.android.gms:play-services-auth-base-license:11.8.0). Searched in the following locations: https://jcenter.bintray.com/com/google/android/gms/play-services-auth-base-license/11.8.0/play-services-auth-base-license-11.8.0.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 13s 14 actionable tasks: 1 executed, 13 up-to-date (node:440) UnhandledPromiseRejectionWarning: Error: /home/alain/PuntoPro/PuntoPro/platforms/android/gradlew: 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-auth.aar (com.google.android.gms:play-services-auth:11.8.0). Searched in the following locations: https://jcenter.bintray.com/com/google/android/gms/play-services-auth/11.8.0/play-services-auth-11.8.0.aar Could not find play-services-identity.aar (com.google.android.gms:play-services-identity:11.8.0). Searched in the following locations: https://jcenter.bintray.com/com/google/android/gms/play-services-identity/11.8.0/play-services-identity-11.8.0.aar Could not find play-services-auth-api-phone.aar (com.google.android.gms:play-services-auth-api-phone:11.8.0). Searched in the following locations: https://jcenter.bintray.com/com/google/android/gms/play-services-auth-api-phone/11.8.0/play-services-auth-api-phone-11.8.0.aar Could not find play-services-auth-base.aar (com.google.android.gms:play-services-auth-base:11.8.0). Searched in the following locations: https://jcenter.bintray.com/com/google/android/gms/play-services-auth-base/11.8.0/play-services-auth-base-11.8.0.aar Could not find play-services-identity-license.aar (com.google.android.gms:play-services-identity-license:11.8.0). Searched in the following locations: https://jcenter.bintray.com/com/google/android/gms/play-services-identity-license/11.8.0/play-services-identity-license-11.8.0.aar Could not find play-services-auth-api-phone-license.aar (com.google.android.gms:play-services-auth-api-phone-license:11.8.0). Searched in the following locations: https://jcenter.bintray.com/com/google/android/gms/play-services-auth-api-phone-license/11.8.0/play-services-auth-api-phone-license-11.8.0.aar Could not find play-services-auth-base-license.aar (com.google.android.gms:play-services-auth-base-license:11.8.0). Searched in the following locations: https://jcenter.bintray.com/com/google/android/gms/play-services-auth-base-license/11.8.0/play-services-auth-base-license-11.8.0.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 13s at ChildProcess.whenDone (/home/alain/PuntoPro/PuntoPro/platforms/android/cordova/node_modules/cordova-common/src/superspawn.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:440) 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:440) [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.
I already searched for the solution, but still nothing, maybe I could help.
Solved the problem by making a small change to the build.gradle file. Basically just change the order, calling first maven {} and then jcenter ()
buildscript {
repositories {
maven {
url "https://maven.google.com"
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
}
}
I solved my problem by removing
maven {
url "https://maven.google.com"
}
in the allprojects { repositeries{ ... } }
lines below the buildscript { ... }
lines.
Then, I add google()
before jcenter()
like that :
allprojects {
repositories {
google()
jcenter()
}
...
}
So in platforms/android/build.gradle file,it should be something like this:
buildscript {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With