我想构建我的项目,但每次我尝试时,控制台都会显示此错误:
Could not find play-services-ads.aar (com.google.android.gms:play-services-ads:12.0.1). Searched in the following locations: https://jcenter.bintray.com/com/google/android/gms/play-services-ads/12.0.1/play-services-ads-12.0.1.aar
但在我的 build.gradle 中我刚刚发现了这个:
compile 'com.google.android.gms:play-services-ads:11.6.0'
所以我不知道这里出了什么问题。 我还使用 Find in Path.. 搜索 12.0.1,但没有发现任何包含此内容的内容。
感谢您的帮助!
最佳答案
我也遇到了同样的问题。尝试将 Google Maven Repo 声明移至项目中所有存储库声明列表的顶部。不要忘记项目级别 build.gradle 中的 allProjects
标记。
allprojects {
repositories {
google() // or maven{ url "https://maven.google.com/" }
jcenter()
}
}
关于java - Android Studio 返回 "Could not find play-services-ads.aar",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50773178/