【发布时间】: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