简体   繁体   中英

Android Studio returns “Could not find play-services-ads.aar”

I want to build my project, but everytime I try this error is shown in console:

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

but in my build.gradle I've just found this:

compile 'com.google.android.gms:play-services-ads:11.6.0'

so I dont know whats the problem here. I also searched with the Find in Path.. for 12.0.1 but I found nothing containing this.

Thanks for helping!

I had the same issue. Try to move the Google Maven Repo declaration to the top of all lists of repository declarations in your project. Don't forget the allProjects tag in your project level build.gradle.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM