Ich habe ein seltsames Problem. Nach dem Hochladen der Google Play Services-Bibliothek von Version 10.2.6 auf Version 11.0.0 erhalte ich beim Kompilieren diese Fehlermeldung:
Fehler: Ausführung fehlgeschlagen für Task ': app: processDebugGoogleServices' . Beheben Sie den Versionskonflikt, indem Sie entweder die Version des Google-Services-Plugins aktualisieren (Informationen zur neuesten Version finden Sie unter https://bintray.com/Android/android-tools/com.google.gms.google-services)/ ) oder Aktualisierung der Version von com.google.Android.gms auf 11.0.0.
Ich habe den im Fehler genannten Link besucht und die letzte Version des Google-Services-Plugins scheint 3.1.0 zu sein, dh die Version, die ich verwende, und ich habe bereits alle Play Services-Bibliotheken auf Version 11.0.0 aktualisiert. Was kann ich tun, um meinen Code mit der GMS-Version 11.0.0 zu kompilieren?
Hier ist meine build.gradle-Datei (Modulumfang):
apply plugin: 'com.Android.application'
apply plugin: 'realm-Android'
Android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.app"
minSdkVersion 15
targetSdkVersion 25
versionCode 23
versionName "0.7.3.2"
testInstrumentationRunner "Android.support.test.runner.AndroidJUnitRunner"
manifestPlaceholders = [onesignal_app_id : "12345678-1234-1234-1234-123456789",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-Android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
prontopro {
applicationId "com.example.app"
buildConfigField "boolean", "TEST_ENVIRONMENT", "false"
}
prontoproTest {
applicationId "com.example.app"
buildConfigField "boolean", "TEST_ENVIRONMENT", "true"
}
}
dataBinding {
enabled = true
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.Android.support:multidex:1.0.1'
compile 'com.Android.support:appcompat-v7:25.3.1'
compile 'com.Android.support:design:25.3.1'
compile 'com.google.Android.gms:play-services-places:11.0.0'
compile 'com.google.Android.gms:play-services-location:11.0.0'
compile 'org.parceler:parceler-api:1.1.6'
annotationProcessor 'org.parceler:parceler:1.1.6'
annotationProcessor 'com.Android.databinding:compiler:2.2.2'
compile 'com.viewpagerindicator:library:2.4.1'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.2'
compile 'com.google.code.gson:gson:2.7'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.github.chrisbanes:PhotoView:1.2.6'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.facebook.Android:facebook-Android-sdk:[4,5)'
compile 'io.realm:Android-adapters:2.0.0'
compile 'com.google.firebase:firebase-crash:10.2.6'
//reactive libraries
compile 'io.reactivex:rxandroid:1.2.1'
compile 'io.reactivex:rxjava:1.2.3'
compile 'com.jakewharton.rxbinding:rxbinding:1.0.0'
compile 'com.jakewharton.rxbinding:rxbinding-support-v4:1.0.0'
compile 'com.jakewharton.rxbinding:rxbinding-appcompat-v7:1.0.0'
compile 'com.jakewharton.rxbinding:rxbinding-design:1.0.0'
compile 'com.jakewharton.rxbinding:rxbinding-recyclerview-v7:1.0.0'
compile 'com.tbruyelle.rxpermissions:rxpermissions:[email protected]'
compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
compile 'com.github.pwittchen:reactivenetwork:0.8.0'
compile 'com.hwangjr.rxbus:rxbus:1.0.5'
compile 'com.f2prateek.rx.preferences:rx-preferences:1.0.2'
//testing
androidTestCompile('com.Android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.Android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:2.6.3'
//onesignal
compile 'com.onesignal:OneSignal:[email protected]'
compile "com.mixpanel.Android:mixpanel-Android:5.1.0"
compile 'com.google.Android.gms:play-services-gcm:11.0.0'
}
apply plugin: 'com.google.gms.google-services'
Zum Schluss noch meine build.gradle-Datei (Anwendungsbereich):
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.Android.tools.build:gradle:2.3.2'
classpath 'io.realm:realm-gradle-plugin:3.1.4'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url "http://dl.bintray.com/populov/maven" }
maven { url "https://jitpack.io" }
mavenCentral()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Sie sollten die Zeile apply plugin: 'com.google.gms.google-services'
löschen.
Weil apply plugin: 'com.Android.application'
bereits dasselbe Paket hat.
Dort entsteht der Konflikt.
AKTUALISIEREN:
Verwenden Sie die Play Services-Version 11.0.1
.
Verwenden Sie Play Service Version 12.0.0
und
in Projektebene Gradle verwenden classpath 'com.google.gms:google-services:3.1.0'
EDITDie Antwort wurde auf die neueste Version aktualisiert
Bereinigen Sie das Projekt nach einem größeren Update von Android Studio und erstellen Sie es erneut. Besser Sie können Version 10 verwenden.
Was für mich funktioniert hat, war folgendes
Projekt Gradle
dependencies {
classpath 'com.Android.tools.build:gradle:2.3.2'
classpath 'com.google.gms:google-services:3.0.0'
App Gradle
compileSdkVersion 26
buildToolsVersion '26.0.0'
defaultConfig {
minSdkVersion 16
targetSdkVersion 26
multiDexEnabled = true
}
abhängigkeiten
// compile 'com.crittercism:crittercism-Android-agent:+'
compile project(':paymentGatewayCommons')
compile project(':Paypal')
compile project(':paytm')
compile project(':payu')
compile 'com.fasterxml.jackson.core:jackson-core:2.9.0.pr1'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.9.0.pr1'
compile 'com.fasterxml.jackson.core:jackson-databind:2.9.0.pr1'
compile 'com.Android.support:multidex:1.0.1'
compile 'com.google.Android.gms:play-services:11.0.1'
compile 'com.google.Android.gms:play-services-base:11.0.1'
//compile 'com.google.Android.gms:play-services-appindexing:11.0.1'
//compile 'com.google.Android.gms:play-services-contextmanager:11.0.1'
compile 'com.google.Android.gms:play-services-places:11.0.1'
compile 'com.google.Android.gms:play-services-nearby:11.0.1'
compile 'com.google.Android.gms:play-services-maps:11.0.1'
compile 'com.google.Android.gms:play-services-ads:11.0.1'
compile 'com.google.Android.gms:play-services-auth:11.0.1'
compile 'com.google.Android.gms:play-services-gcm:11.0.1'
compile 'com.google.Android.gms:play-services-analytics:11.0.1'
compile 'com.google.Android.gms:play-services-location:11.0.1'
compile 'com.google.maps.Android:android-maps-utils:0.4.+'
compile 'com.google.zxing:core:3.2.0'
compile 'com.journeyapps:zxing-Android-embedded:[email protected]'
compile 'com.google.firebase:firebase-messaging:11.0.1'
compile 'com.google.firebase:firebase-core:11.0.1'
compile 'com.google.firebase:firebase-analytics:11.0.1'
compile 'com.flurry.Android:analytics:6.4.2'
compile 'com.Android.support.constraint:constraint-layout:+'
testCompile 'junit:junit:4.12'
Sie haben das Problem wahrscheinlich alle behoben, aber das Update des Firebase-Plugins auf 11.0.1 hat das Problem für mich behoben.
Versuchen Sie, direkt auf die erforderlichen Dienste zu zielen, wenn Sie SmsRetriver kompilieren möchten
compile 'com.google.Android.gms:play-services-auth-api-phone:11.0.1'
Eher, als
compile 'com.google.Android.gms:play-services:11.0.1'