找不到play-services-basement.aar [英] Could not find play-services-basement.aar

查看:170
本文介绍了找不到play-services-basement.aar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

昨天我尝试构建我的应用程序,并且一切正常.

Yesterday I tried building my app and everything worked fine.

今天,没有对项目进行任何更改...突然间,我收到一条警告消息,告诉我:

Today, without any changes to the project... All of a sudden I'm greeted with this warning message telling me:

Error:Could not find play-services-basement.aar (com.google.android.gms:play-services-basement:11.0.1). 
Searched in the following locations:
    https://jcenter.bintray.com/com/google/android/gms/play-services-basement/11.0.1/play-services-basement-11.0.1.aar

有人遇到同样的问题吗?

Is anyone experiencing the same sort of issue?

如果您在链接中搜索软件包,则基本上可以通过浏览器立即下载该链接.我想服务器端发生了什么变化?也许是命名约定?

If you follow the link where it's searching for the package it basically gets downloaded instantly through the browser. I suppose something has changed on the server side? Perhaps naming conventions?

看起来正在寻找:play-services-basement.aar,而是获取play-services-basement-11.0.1.aar吗? 这可能是命名约定还是gradle问题?

It looks like it's looking for: play-services-basement.aar and fetches play-services-basement-11.0.1.aar instead? Could this be a naming convention or gradle issue?

推荐答案

jcenter()具有一些本应通过google()或maven()存储库提供的库(我想它们是有意做的)的镜像.当gradle build起作用时,对于项目中使用的任何库,首先要查找的是repositories {..中首先列出的存储库,当jcenter()镜像没有发布时(例如com.google.android). gms:play-services-ads:15.0.1(对于我的情况)是您的gradle所寻找的,构建失败并出现此类错误.

jcenter() has had mirrors of some libraries (I guess they are doing intentionally) that should originally available through google() or maven() repositories. When gradle build works, for any library that is used in the project the first place to look for is the repository that is listed first in repositories {.. When the jcenter() mirror does not have the release (e.g com.google.android.gms:play-services-ads:15.0.1 for my case) your gradle is looking for, the build fails with such error.

因此,jcenter()应该在repositories {..部分的最后位置列出,如下所示.

So, jcenter() should be listed at the last place in repositories {.. parts as below.

   buildscript {
    ext.kotlin_version = '1.2.50'
    repositories {
        google()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        jcenter()
    }...

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

这篇关于找不到play-services-basement.aar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆