Gary Klasen
Gary Klasen

Reputation: 1070

Ionic3 Build-Error: Could not find play-services-auth-base.aar (15.0.1)

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:

Code:

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

Upvotes: 6

Views: 5884

Answers (4)

KnechtRootrecht
KnechtRootrecht

Reputation: 457

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.

Upvotes: 0

Petru
Petru

Reputation: 231

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

maven { url 'maven.google.com'; }

instead of

google()

Upvotes: 1

MW.
MW.

Reputation: 564

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:

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

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

It's important that google() is listed before jcenter().

Upvotes: 15

davyww
davyww

Reputation: 121

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.

Upvotes: 3

Related Questions