我得到一個錯誤說版本衝突升級發揮服務9.4.0的Android Studio 2.2中
Error:Execution failed for task ':app:processDebugGoogleServices'.
> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.0.0.
我試圖尋找在https://bintray.com/android/android-tools/com.google.gms.google-services/和com.google.gms:谷歌服務:3.0.0似乎是最新的。這是我的gradle項目
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
這是我的應用程序gradle這個看起來像
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.myapp.preburn"
minSdkVersion 10
targetSdkVersion 24
versionCode 14
versionName "2.0.1"
renderscriptTargetApi 22
renderscriptSupportModeEnabled true
}
buildTypes {
release {
lintOptions {
disable 'MissingTranslation'
}
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
android {
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(dir: 'libs', include: 'Parse-*.jar')
compile 'com.parse.bolts:bolts-android:1.2.0'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.mcxiaoke.volley:library:1.0.9'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.google.android.gms:play-services-location:9.4.0'
compile 'com.google.android.gms:play-services-maps:9.4.0'
compile 'com.google.android.gms:play-services-ads:9.4.0'
compile 'com.google.android.gms:play-services-plus:9.4.0'
compile 'com.google.android.gms:play-services-analytics:9.4.0'
compile 'me.leolin:ShortcutBadger:[email protected]'
compile 'com.squareup.picasso:picasso:2.5.2'
compile files('libs/jsoup-1.7.3.jar')
compile('com.crashlytics.sdk.android:crashlytics:[email protected]') {
transitive = true;
}
compile files('libs/InMobi-5.2.2.jar')
compile files('libs/libadapterinmobi.jar')
compile files('libs/StartAppAdMobMediation-1.0.1.jar')
compile files('libs/StartAppInApp-3.3.1.jar')
compile 'org.adw.library:discrete-seekbar:1.0.1'
compile 'com.pnikosis:materialish-progress:1.0'
}
如果我改打服務9.0.0一切編譯罰款。我在這裏錯過了什麼?
謝謝。這工作! – tbag
是的,它的工作原理。只是好奇,我把應用插件.....頂部的塊,似乎不起作用。爲什麼它必須在塊之下? –
@LongDao - 該文件與計算機程序比配置文件有更多共同之處 - 它是按順序讀取和執行的。通過在'dependencies'塊之前放置'apply plugin'行,插件會在知道您實際使用的Google Play服務的版本之前執行並配置您的版本 - 它實際上不能「預讀」 – ianhanniballake