Mar*_*ker 23 android gradle google-play-services build.gradle android-gradle-plugin
Android SDK Manager今天早上通知我有一个新的Google Play Services版本要下载:版本18.那么如何找到相应的长版本号放在build.gradle文件中?我的所有测试设备都运行5.0.84版,所以我尝试更新
compile 'com.google.android.gms:play-services:4.4.52'
至
compile 'com.google.android.gms:play-services:5.0.84'
但是这导致了一个错误:
Gradle'MyApp'项目刷新失败:找不到com.google.android.gms:play-services:5.0.84.要求:{我的应用} Gradle设置
我正在运行Android Studio 0.5.2并为API19构建(我还没有升级到Android L/API20):也许这就是问题所在?但一般来说,如何将SDK Manager(例如18)中显示的修订号与build.gradle的版本代码(例如5.0.84)相匹配?
这是我的完整build.gradle,以防它有帮助:
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.1.0"
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
// Avoid "Duplicate files copied in APK" errors when using Jackson
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
}
dependencies {
// Was "compile 'com.android.support:support-v4:+'" but this caused build errors when L SDK released
compile 'com.android.support:support-v4:19.1.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
// Support for Google Cloud Messaging
// Was "compile 'com.android.support:appcompat-v7:+'" but this caused build errors when L SDK released
compile 'com.android.support:appcompat-v7:19.1.0'
compile 'com.google.android.gms:play-services:5.0.84'
// Jackson
compile 'com.fasterxml.jackson.core:jackson-core:2.3.3'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.3.3'
compile 'com.fasterxml.jackson.core:jackson-databind:2.3.3'
}