【发布时间】:2017-10-03 20:03:37
【问题描述】:
我想使用 AdMob 向我的应用添加一些广告,该网站说我需要将 Google 服务添加到依赖项中才能使用此功能。因此,使用 Android Studio,我转到 File->Project Structure->app->Dependencies,单击“+”按钮并搜索“play-services”。我发现的是“com.google.android.gms:play-services:9.4.0”所以我将它添加到依赖项中。然而,在 gradle 同步期间,Android Studio 会发送一些错误并停止 gradle 同步。
这是我从同步中获得的日志:http://pastebin.com/ZpN4RUcm
这里有一些可能有用的数据:
- 编译 SDK 版本:API 17
- 构建工具版本:23.0.1
- 安卓 工作室 2.1.2
这是我的主要 gradle 文件:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
}
}
allprojects {
repositories {
jcenter()
}
}
这是我的应用程序 gradle 文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 'Google Inc.:Google APIs:17'
buildToolsVersion '23.0.1'
defaultConfig {
applicationId "com.serpenssolida.glowdodger"
minSdkVersion 10
targetSdkVersion 17
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile 'com.android.support:support-v4:17.0.0'
compile files('libs/processing-core.jar')
compile project(':facebook')
compile 'com.google.android.gms:play-services:9.4.0'
}
我怎样才能摆脱所有的错误?
【问题讨论】:
标签: android android-gradle-plugin google-play-services