2016-07-03 17 views
0

ich die folgende Störung erhalte:Konflikt mit Abhängigkeits 'com.google.inject: guice'

Fehler: Konflikt mit Abhängigkeits 'com.google.inject: guice'. Gelöste Versionen für App (3.0) und Test-App (4.0) unterscheiden sich. Details finden Sie unter http://g.co/androidstudio/app-test-app-conflict.

Folgende ist meine Gradle Datei:

buildscript { 
repositories { 
    maven { url 'https://maven.fabric.io/public'} 

} 

dependencies { 
    classpath 'io.fabric.tools:gradle:1.19.1' 


} 
} 
apply plugin: 'com.android.application' 
apply plugin: 'io.fabric' 
apply plugin: 'me.tatarka.retrolambda' 
apply plugin: 'android-apt' 

repositories { 
maven { url 'https://maven.fabric.io/public' } 
jcenter() 
maven { url "https://jitpack.io" } 
maven { url 'https://dl.bintray.com/intercom/intercom-maven' } 


} 



android { 
compileSdkVersion 23 
buildToolsVersion "23.0.3" 
defaultConfig { 
    applicationId "com.imagecom" 
    minSdkVersion 16 
    targetSdkVersion 22 
    versionCode 16 
    versionName "3.8" 
    multiDexEnabled = true 
    testInstrumentationRunner  "com.android.test.runner.MultiDexTestRunner" 
    useLibrary 'org.apache.http.legacy' 
} 
compileOptions { 
    sourceCompatibility JavaVersion.VERSION_1_8 
    targetCompatibility JavaVersion.VERSION_1_8 
} 

signingConfigs{ 
    release{ 
     storeFile file(STORE_FILE) 
     storePassword STORE_PASSWORD 
     keyAlias STORE_PASSWORD 
     keyPassword STORE_PASSWORD 
    } 

    debug{ 
     storeFile file(STORE_FILE_DEBUG) 
     storePassword STORE_PASSWORD_DEBUG 
     keyAlias STORE_PASSWORD_DEBUG 
     keyPassword STORE_PASSWORD_DEBUG 
    } 
} 



packagingOptions { 
    exclude 'META-INF/LICENSE' 
    exclude 'META-INF/notice.txt' 
    exclude 'META-INF/license.txt' 
    exclude 'META-INF/NOTICE' 
    exclude 'META-INF/ASL2.0' 
    exclude 'META-INF/LICENSE.txt' 
    exclude 'META-INF/NOTICE.txt' 
    exclude 'META-INF/maven/com.google.guava/guava/pom.xml' 
    exclude 'META-INF/maven/com.google.guava/guava/pom.properties' 
    //exclude 'META-INF/DEPENDENCIES' 

} 
dexOptions { 
    javaMaxHeapSize "7g" 

} 
lintOptions { 
    abortOnError false 
    checkReleaseBuilds false 
} 
buildTypes { 
    release { 
     minifyEnabled false 
     shrinkResources true 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 
    debug { 
     minifyEnabled false 
     shrinkResources true 
     applicationIdSuffix ".debug" 
    } 
    sourceSets.debug.resources.srcDirs = ['src/debug/res'] 


} 
productFlavors { 
    imagecom { 
     applicationId "com.imagecom.imagecom" 
     versionName = "7.7" 
    } 
    greencontrol { 
     applicationId "com.imagecom.greencontrol" 
     versionName = "1.0-greencontrol" 
    } 
} 


configurations.all { 
    resolutionStrategy { 
     force 'com.android.support:support-annotations:23.3.0' 
    } 
} 



} 
dependencies { 
compile fileTree(dir: 'libs', include: '*.jar') 
compile('org.apache.httpcomponents:httpmime:4.2.3') { 
    exclude group: 'org.apache.httpcomponents', module: 'httpcore' 
} 
compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
    transitive = true; 
} 

compile project(':bluetoothspp') 
compile('io.intercom.android:intercom-sdk:[email protected]') { 
    transitive = true 
} 

compile 'com.android.support:design:23.3.0' 
compile 'com.android.support:multidex:1.0.1' 
androidTestCompile('com.android.support:multidex-instrumentation:1.0.1') { 
    exclude group: 'com.android.support', module: 'multidex' 
} 
compile 'com.android.support:support-v4:23.3.0' 
compile 'com.android.support:appcompat-v7:23.3.0' 
compile 'com.android.support:recyclerview-v7:23.3.0' 
compile 'com.android.support:cardview-v7:23.3.0' 
compile 'com.android.support:palette-v7:23.3.0' 
compile 'de.greenrobot:greendao:1.3.7' 
compile 'com.mixpanel.android:mixpanel-android:4.5.3' 
compile 'me.neavo:volley:2014.12.09' 
compile 'com.squareup.okhttp:okhttp:2.3.0' 
compile 'com.google.code.gson:gson:2.2.4' 
compile 'org.modelmapper:modelmapper:0.7.4' 
compile 'com.theartofdev.edmodo:android-image-cropper:1.0.+' 
compile 'com.nineoldandroids:library:2.4.0' 
compile 'com.melnykov:floatingactionbutton:1.3.0' 
compile 'me.relex:circleindicator:[email protected]' 
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4' 
compile 'com.jakewharton:butterknife:6.1.0' 
compile 'com.github.deano2390:MaterialShowcaseView:1.0.5' 
compile 'org.roboguice:roboguice:2.0' 
provided 'org.roboguice:roboblender:3.0.1' 
compile 'joda-time:joda-time:2.8.2' 
compile 'me.dm7.barcodescanner:zxing:1.8.3' 
compile 'it.sephiroth.android.library.targettooltip:target-tooltip-library:1.3.2a' 
compile 'com.facebook.android:facebook-android-sdk:4.6.0' 
compile 'com.google.android.gms:play-services-gcm:8.4.0' 
compile 'com.google.android.gms:play-services-location:8.4.0' 
compile 'com.google.android.gms:play-services-maps:8.4.0' 
compile 'com.google.android.gms:play-services-appindexing:8.4.0' 
compile 'com.google.android.gms:play-services-auth:8.4.0' 
compile 'com.github.PhilJay:MPAndroidChart:v2.2.0' 
compile 'io.reactivex:rxandroid:1.1.0' 
compile 'com.github.hotchemi:permissionsdispatcher:2.0.8' 
apt 'com.github.hotchemi:permissionsdispatcher-processor:2.0.8' 
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta2' 
//Retrofit 2 
compile 'com.google.code.gson:gson:2.6.2' 
compile 'com.squareup.retrofit2:retrofit:2.0.1' 
compile 'com.squareup.retrofit2:converter-gson:2.0.1' 
compile 'com.squareup.okhttp3:okhttp:3.2.0' 
compile 'com.squareup.okhttp3:logging-interceptor:3.2.0' 
compile 'org.apache.commons:commons-lang3:3.4' 
testCompile 'junit:junit:4.12' 
testCompile ('org.robolectric:robolectric:3.0'){ 
    exclude module: 'asm' 
} 

androidTestCompile 'org.testng:testng:6.9.6' 
androidTestCompile 'junit:junit:4.12' 
} 

apply plugin: 'com.google.gms.google-services' 
def appModuleRootFolder = '.' 
def srcDir = 'src' 
def googleServicesJson = 'google-services.json' 

task switchToDebug(type: Copy) { 
description = 'Switches to DEBUG google-services.json' 
from "src/debug" 
include "google-services.json" 
into "." 
} 

task switchToRelease(type: Copy) { 
description = 'Switches to RELEASE google-services.json' 
from "src/release" 
include "google-services.json" 
into "." 
    } 

task switchToDebugGreencontrol(type: Copy) { 
description = 'Switches to DEBUG google-services.json' 
from "src/debug/greencontrol" 
include "google-services.json" 
into "." 
} 

task switchToReleaseGreencontrol(type: Copy) { 
description = 'Switches to RELEASE google-services.json' 
from "src/release/greencontrol" 
include "google-services.json" 
into "." 
} 



afterEvaluate { 
processimagecomDebugGoogleServices.dependsOn switchToDebug 
processimagecomReleaseGoogleServices.dependsOn switchToRelease 
processGreencontrolDebugGoogleServices.dependsOn  switchToDebugGreencontrol 
processGreencontrolReleaseGoogleServices.dependsOn switchToReleaseGreencontrol 
} 

Es folgt die gradle von bluetoothspp Projekt:

apply plugin: 'com.android.library' 

android { 
compileSdkVersion 22 
buildToolsVersion "22.0.0" 

defaultConfig { 
    versionCode 7 
    versionName "3.3" 
} 

sourceSets { 
    main { 
     manifest.srcFile 'src/main/AndroidManifest.xml' 
     java.srcDirs = ['src/main/java'] 
     res.srcDirs = ['src/main/res'] 
    } 
} 
} 
+0

Können Sie bitte die Build.gradle 'Bluetoothspp' Projekt teilen? – yonisha

+0

Hallo, ich habe die Gradle für Bluetoothsp auch hinzugefügt –

+0

Wie in dem Link in den Fehler angegeben, zwei verschiedene Versionen von * 'com.google.inject: guice' * durch Ihre Abhängigkeiten verwiesen. Ich würde vorschlagen, zu starten: '** gradlew : Abhängigkeiten **', um zu überprüfen, wer davon abhängig ist und die Duplizierung zu beseitigen. – yonisha

Antwort

1

Das Problem mit dem Cache war die doppelten Dateien hatten, die weder verschmolzen immer noch gelöscht zu werden wenn ich sauber drücke und die Projektoption neu aufbaue.

Da ich mein Projekt mit bitbucket verknüpft hatte, habe ich es mit Source-Tree gespeichert.

Folgender Link wäre hilfreich, wie Stash: https://confluence.atlassian.com/sourcetreekb/stash-a-file-with-sourcetree-785332122.html

und dann reinigte ich und mein Projekt neu und der Fehler verschwunden war. Das sollte es auch für euch tun.

Vielen Dank