【问题标题】:Android Studio 2.3.3: Failed to resolve: com.google.android.gms:play-services-ads:11.8.0 even with MavenAndroid Studio 2.3.3:即使使用 Maven 也无法解决:com.google.android.gms:play-services-ads:11.8.0
【发布时间】:2018-06-29 08:59:35
【问题描述】:

我正在 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?

【问题讨论】:

    标签: java android maven android-studio


    【解决方案1】:

    你该走了

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

    并检查 Google Play 服务的最新版本 (11.8.0) 并确定。 最后,在 build.gradle 中看到它们具有相同的版本。 enter image description here

    【讨论】:

      猜你喜欢
      • 2019-04-15
      • 2018-11-23
      • 1970-01-01
      • 2021-01-10
      • 2019-04-17
      • 1970-01-01
      • 2016-10-09
      • 2018-01-04
      • 2017-03-06
      相关资源
      最近更新 更多