2016-11-01 4 views
0

Ich versuche, die MapBox-Bibliothek zum Projekt hinzuzufügen. Wenn ich jedoch versuche, die App auszuführen, fällt sie immer mit 1 Fehler aus.Gradle-Fehler - Ausführung für Aufgabe fehlgeschlagen app: prepareDebugAndroidTestDependencies

build.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.neenbedankt.android-apt' 
apply plugin: 'realm-android' 
apply from: '../config/quality/quality.gradle' 


android { 
    compileSdkVersion 25 
    buildToolsVersion "24.0.3" 
    defaultConfig { 
     applicationId "com.hopegasolane" 
     minSdkVersion 16 
     targetSdkVersion 25 
     versionCode 1 
     versionName "1.0" 
} 

signingConfigs { 
    release { 
     storeFile file('keystore/release.keystore') 
     keyAlias 'alias' 
     storePassword "$System.env.APP_KEY" 
     keyPassword "$System.env.APP_KEY" 
    } 

    debug { 
     storeFile file('keystore/debug.keystore') 
     keyAlias 'androiddebugkey' 
     storePassword 'android' 
     keyPassword 'android' 
    } 
} 

buildTypes { 
    release { 
     signingConfig signingConfigs.release 

     minifyEnabled true 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 

    debug { 
     versionNameSuffix " Debug" 
     debuggable true 
    } 
} 

lintOptions { 
    warning 'InvalidPackage' 
    } 
} 

repositories { 
jcenter() 
maven { 
    url 'https://github.com/uPhyca/stetho-realm/raw/master/maven-repo' 
} 
maven { url 'https://maven.fabric.io/public' } 
} 

dependencies { 
    final PLAY_SERVICES_VERSION = '9.8.0' 
    final SUPPORT_LIBRARY_VERSION = '25.0.0' 
    final RETROFIT_VERSION = '2.1.0' 
    final DAGGER_VERSION = '2.5' 
    final DEXMAKER_VERSION = '1.4' 
    final HAMCREST_VERSION = '1.3' 
    final ESPRESSO_VERSION = '2.2.2' 
    final RUNNER_VERSION = '0.4' 
    final BUTTERKNIFE_VERSION = '8.4.0' 
    final TRANSITIONS_EVERYWHERE = '1.6.9' 

    def daggerCompiler = "com.google.dagger:dagger-compiler:$DAGGER_VERSION" 
    def jUnit = "junit:junit:4.12" 
    def mockito = "org.mockito:mockito-core:1.10.19" 


    compile "com.google.android.gms:play-services-gcm:$PLAY_SERVICES_VERSION" 
    compile "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION" 
    compile "com.android.support:recyclerview-v7:$SUPPORT_LIBRARY_VERSION" 
    compile "com.android.support:cardview-v7:$SUPPORT_LIBRARY_VERSION" 
    compile "com.android.support:support-annotations:$SUPPORT_LIBRARY_VERSION" 
    compile "com.android.support:design:$SUPPORT_LIBRARY_VERSION" 

    compile "com.squareup.retrofit2:retrofit:$RETROFIT_VERSION" 
    compile "com.squareup.retrofit2:converter-gson:$RETROFIT_VERSION" 
    compile "com.squareup.retrofit2:adapter-rxjava:$RETROFIT_VERSION" 

    compile "com.andkulikov:transitionseverywhere:$TRANSITIONS_EVERYWHERE" 


    compile "com.jakewharton:butterknife:$BUTTERKNIFE_VERSION" 
    apt "com.jakewharton:butterknife-compiler:$BUTTERKNIFE_VERSION" 


    compile "com.google.dagger:dagger:$DAGGER_VERSION" 
    apt daggerCompiler 
    testApt daggerCompiler 


    androidTestCompile jUnit 
    androidTestCompile mockito 
    androidTestCompile "com.android.support:support-annotations:$SUPPORT_LIBRARY_VERSION" 
    androidTestCompile("com.android.support.test.espresso:espresso-contrib:$ESPRESSO_VERSION") { 
     exclude group: 'com.android.support', module: 'appcompat' 
     exclude group: 'com.android.support', module: 'support-v4' 
     exclude group: 'com.android.support', module: 'recyclerview-v7' 
    } 
    androidTestCompile "com.android.support.test.espresso:espresso-core:$ESPRESSO_VERSION" 
    androidTestCompile "com.android.support.test:runner:$RUNNER_VERSION" 
    androidTestCompile "com.android.support.test:rules:$RUNNER_VERSION" 
    androidTestCompile "com.crittercism.dexmaker:dexmaker:$DEXMAKER_VERSION" 
    androidTestCompile "com.crittercism.dexmaker:dexmaker-dx:$DEXMAKER_VERSION" 
    androidTestCompile "com.crittercism.dexmaker:dexmaker-mockito:$DEXMAKER_VERSION" 


    testCompile jUnit 
    testCompile mockito 
    testCompile "org.hamcrest:hamcrest-core:$HAMCREST_VERSION" 
    testCompile "org.hamcrest:hamcrest-library:$HAMCREST_VERSION" 
    testCompile "org.hamcrest:hamcrest-integration:$HAMCREST_VERSION" 
    compile 'com.squareup.okhttp3:logging-interceptor:3.3.1' 
    compile 'com.github.bumptech.glide:glide:3.7.0' 
    compile 'io.reactivex:rxandroid:1.2.1' 
    compile 'io.reactivex:rxjava:1.1.6' 
    compile 'com.facebook.stetho:stetho:1.4.1' 
    compile 'com.uphyca:stetho_realm:2.0.0' 
    compile 'com.jakewharton.timber:timber:4.1.2' 
    testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5' 
    testCompile 'org.robolectric:robolectric:3.1' 
    annotationProcessor 'com.squareup:javapoet:1.7.0' 
    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5' 
    provided 'org.glassfish:javax.annotation:10.0-b28' 
    releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5' 
    compile('com.mapbox.mapboxsdk:mapbox-android-sdk:[email protected]') { 
     transitive = true; 
    } 
    compile('io.fabric.sdk.android:fabric:[email protected]') { 
     transitive = true; 
    } 
} 

Hier ist Fehlermeldung:

Warning:Conflict with dependency 'com.google.guava:guava'. Resolved versions for app (18.0) and test app (19.0-rc2) differ. See http://g.co/androidstudio/app-test-app-conflict for details.

Error:Execution failed for task ':app:prepareDebugAndroidTestDependencies'. Dependency Error. See console for details.

EDIT

compile('com.mapbox.mapboxsdk:mapbox-android-sdk:[email protected]') { 
    transitive = true; 
    compile 'com.google.guava:guava:19.0-rc2' 
    exclude group: 'com.google.guava', module: 'guava' 
} 
+0

funktioniert es normal, wenn Sie die Mapbox-Abhängigkeit entfernen? –

+0

@AramTchekrekjian ja funktioniert gut – Drake

+0

Mai Mapbox-Bibliothek mit Guava libarary innerhalb, und die Version ist Konflikt für App und Test-App. Guave-Bibliothek aus der Kartenbox ausschließen und manuell hinzufügen –

Antwort

1

Meines Wissens Guave ist nicht eine Abhängigkeit für die MapBox Android SDK ... Beim Betrachten deiner Editierung sollte die Mapbox-Android-Abhängigkeit stehen nur sein:

compile('com.mapbox.mapboxsdk:mapbox-android-sdk:[email protected]') { 
    transitive = true; 
} 

Wie in Ihrem ursprünglichen Beitrag. Wenn weiterhin Probleme auftreten, hilft das Bereitstellen der gesamten Fehlermeldung.

Verwandte Themen