i have a bigger Ionic3 project running and did not do any changes since i had a successful build last time. Today, i tried to build again, getting the error:
Could not find play-services-auth-base.aar (com.google.android.gms:play-services-auth-base:15.0.1).
I can not figure out why this happens. Cordova-platform is Version 6.3.0.
Steps done so far:
Installed
cordova-android-play-services-gradle-release
, which 15.+ as version during the buildInstalled
cordova-android-support-gradle-release
, which 27.+ as version during the buildManipulated
gradle.build
within the platform, as recommended in other stackoverflow-questions.Maybe updating cordova to 7.x also is an option, but i want to avoid it due to multiple cordova plugin dependencies.
Code:
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
As far as I can see, this error may also occur, when Google or anyone else marks the repository "google-cache" as "blacked-out". Then instead of getting the library you want, you'll get a json string representig that error. It seems that this is enough information for Android Studio to say "OK, found a library entry, but its not there", so the build will fail. google() or maven() should then provide a backup entry, but because jcenter() was the first repository in the list and has given a "proper answer" of the request gradle won't ask the other repos for a solution.
As @Manuel already posted, just put the google() repo before jcenter() in your projects build.gradle.
If your app does not require any of the newer Google APIs, try specifying an older Play Services Version in your config.xml file. I got a successful build by using 11.6.2. Anything newer gave me the same build error.
There is currently something wrong with the jcenter() repository. I guess they will fix that soon.
Anyway, for the most packages a fix could be to add the google() repository at the first position in the build.gradle file:
It's important that google() is listed before jcenter().
According to this: https://developer.android.com/topic/libraries/support-library/setup
if you're using a version of Gradle lower than 4.1, you must use
instead of