Ich bekomme den folgenden Fehler, wenn ich Fire Base Analytics in meinem Android Studio-Projekt hinzufügen: "Fehler: Fehler beim Konvertieren von Bytecode zu dex: Ursache: com.android.dex .DexException: Mehrere Dex-Dateien definieren Lcom/google/android/gms/measurement/AppMeasurementContentProvider; "Mehrere Dex-Datei Fehler beim Hinzufügen von Fire Base-Analysen in Android Studio
Ich bin wirklich dankbar, wenn mir jemand sagt, woher der zusätzliche AppMeasurementContentProvider kommt und den entsprechenden "exclude" -Befehl.
Hier ist meine build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 21
buildToolsVersion "22.0.1"
lintOptions {
abortOnError false
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/maven/com.google.guava/guava/pom.properties'
exclude 'META-INF/maven/com.google.guava/guava/pom.xml'
exclude 'com.google.android.gms.measurement'
}
defaultConfig {
applicationId "com.elisiumlabs.sarthi"
minSdkVersion 10
targetSdkVersion 19
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
compile project(':androidQuery')
compile project(':pinnedSectionListActivity')
compile project(':volley')
compile project(':facebookSDK')
compile 'com.google.code.gson:gson:2.2.4'
compile 'joda-time:joda-time:2.3'
compile 'com.android.support:gridlayout-v7:21.0.0'
compile "com.google.android.gms:play-services-location:8.3.0"
// compile "com.google.android.gms:play-services-gcm:8.3.0"
compile 'com.android.support:appcompat-v7:21.0.3'
compile('com.google.android.gms:play-services-gcm:8.3.0') {
exclude group: 'com.google.android.gms.measurement'
}
compile('com.google.firebase:firebase-core:9.0.2')
{
exclude group: 'com.google.android.gms.measurement'
}
/*compile files('libs/appcompat_v7.jar')*/
compile files('libs/commons-io-1.4.jar')
compile files('libs/commons-lang-2.4.jar')
compile files('libs/httpclient-4.3.5.jar')
/*compile files('libs/objectify-5.0.3.jar')*/
compile 'commons-codec:commons-codec:1.9'
compile files('libs/splunk-mint-4.1.jar')
testCompile 'junit:junit:4.12'
// androidTestCompile 'com.android.support:support-annotations:21.0.0'
androidTestCompile 'com.android.support.test:runner:0.4.1'
androidTestCompile 'com.android.support.test:rules:0.4.1'
// Optional -- Hamcrest library
androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
// Optional -- UI testing with Espresso
/* androidTestCompile('com.android.support.test.espresso:espresso- core:2.2.1') {
// Necessary if your app targets Marshmallow (since Espresso
// hasn't moved to Marshmallow yet)
exclude group: 'com.android.support', module: 'support-annotations'
}*/
androidTestCompile('com.android.support.test.espresso:espresso- contrib:2.2.2') {
// Necessary if your app targets Marshmallow (since Espresso
// hasn't moved to Marshmallow yet)
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'javax.inject'
exclude group: 'com.android.support'
}
androidTestCompile('com.android.support.test.espresso:espresso-web:2.2.2'){
// Necessary if your app targets Marshmallow (since Espresso
// hasn't moved to Marshmallow yet)
exclude group: 'com.android.support', module: 'support-annotations'
}
// Optional -- UI testing with UI Automator
androidTestCompile('com.android.support.test.uiautomator:uiautomator-v18:2.1.1'){
// Necessary if your app targets Marshmallow (since the test runner
// hasn't moved to Marshmallow yet)
exclude group: 'com.android.support', module: 'support-annotations'
}
}
configurations.all {
resolutionStrategy {
force 'com.android.support:support-annotations:23.0.1'
}
}