Gradle build tool cannot find play-services-tasks.aar? Why?

六眼飞鱼酱① 提交于 2019-11-26 11:53:29
Ivan Rigamonti

After doing the following changes the error disappeared:

  1. Removed maven { url 'https://maven.google.com' } from repositories in app build.gradle.
  2. Added maven { url 'https://maven.google.com' } as first entry in allprojects/repositories in top level build.gradle
  3. Changed all play-services and firebase dependencies to the latest versions
  4. Changed version of google-services plugin to classpath 'com.google.gms:google-services:4.0.1'

The fix is to put google url above jcenter() in your repository list in gradle.

Here's the issue: https://issuetracker.google.com/issues/80362794

in my case:

allprojects {
    repositories {
        google()
        jcenter()
    }
}

solves my problems

  • in my old configuration was only "jcenter()"
  • first line jcenter(), second line google() doesn't work

I am getting the same issue today. It was working fine until now. Maybe it's a temporary Google servers issue.

The solution that works for me is using an older version of google-play-services:

implementation 'com.google.android.gms:play-services-maps:11.4.2'

For my case I removed mavenCentral() from app gradle repositores and moved maven { url 'https://maven.google.com' } to the first positionin in project gradle as Ivan Rigamonti suggested above. No Firebase dependecies update needed.

(this should be a comment, but I don't have enough reputation)

Change

compile 'com.google.android.gms:play-services-safetynet:15.0.1'
compile 'com.google.android.gms:play-services-maps:15.0.1'
compile 'com.google.android.gms:play-services-places:15.0.1'
compile 'com.google.android.gms:play-services-location:15.0.1'

to

compile 'com.google.android.gms:play-services-safetynet:16.0.0'
compile 'com.google.android.gms:play-services-maps:16.0.0'
compile 'com.google.android.gms:play-services-places:16.0.0'
compile 'com.google.android.gms:play-services-location:16.0.0'

Is my case, it works!

Could it be that google changed the naming conventions of the packages on the server side?

I'm experiencing the same sort of issue with a different play services package just now.

Namely play-services-basement.aar...

I'm thinking that

Could not find play-services-tasks.aar

Means it's looking for the file named as play-services-tasks.aar

While on the server this file is called:

play-services-tasks-15.0.1.aar

I'm thinking this is either a gradle issue where files aren't named correctly or a server side issue where files aren't named correctly.

Please correct me if I'm mistaken here.

EDIT: this issue should be reported to jcenter.bintray.com since they are the ones being at fault here at their server side. Switching to the Maven repository mentioned by Ivan Rigamonti could be a solution but I'm uncertain how ionic apps deal with switching repositories.

EDIT2: Switching to the maven repository does indeed work for ionic. All I had to do for ionic was to alter build.gradle by putting jcenter() underneath maven() inside of the buildscript repositories and allprojects repositories.

if you Guys Getting Error Like build.gradle error , Failed to resolve: common like this build.gradle error , Failed to resolve: common

then put below line in allprojects scope in repositories scope in Project build.gradle

line :

 maven { url 'https://maven.google.com' }
        jcenter()
        google()

example

allprojects {
    repositories {
        maven { url 'https://maven.google.com' }
        jcenter()
        google()
    }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!