簡體   English   中英

Android Studio 2.3.3:即使使用Maven也無法解析:com.google.android.gms:play-services-ads:11.8.0

[英]Android Studio 2.3.3: Failed to resolve: com.google.android.gms:play-services-ads:11.8.0 even with Maven

我正在使用Android Studio開發首批應用程序之一,並希望使用Admob向其添加廣告。 在我的gradle:項目中,我有Maven:

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.2.3'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
repositories {
    jcenter()

    maven {
        url "https://maven.google.com"
    }
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

這也是我的應用程序級別的build.gradle依賴項

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})

compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.google.android.gms:play-services-ads:11.8.0'
compile 'com.android.support:design:23.4.0'
testCompile 'junit:junit:4.12'

}

即使我的存儲庫中有Maven,我仍然會收到錯誤消息:無法解決:com.google.android.gms:play-services-ads:11.8.0

maven {url“ https://maven.google.com ”}是否足以導入Mobile Ads sdk?

你得走了

工具> Android> SDK管理器> SDK工具

並檢查Google Play服務的最新版本(11.8.0),然后確定。 最后,在build.gradle中看到它們具有相同的版本。 在此處輸入圖片說明

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM