multidex错误不断崩溃

时间:2018-01-03 18:43:25

标签: android gradle

我刚尝试了我在stackoverflow上找到的所有东西,我无法解决我的问题,我启用了多索引并禁用了miniyfenabled并且没有发生任何事情,这是我的应用build.gradle,我找不到问题而且正在获取现在3小时后很烦人。

android {
    signingConfigs {
    }
    compileSdkVersion 26
    buildToolsVersion '26.0.2'
    useLibrary 'org.apache.http.legacy'
    defaultConfig {
        applicationId "com.xxxx.xxxx"
        minSdkVersion 19
        targetSdkVersion 26
        versionCode 38
        versionName "4.3.0" //
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        // Enabling multidex support.
        multiDexEnabled true
    }
    dexOptions {
        preDexLibraries = false
        javaMaxHeapSize "4g"
    }
    buildTypes {
        debug {
            applicationIdSuffix '.debug'
        }
        //sourceSets.debug.resources.srcDirs = ['src/debug/res']
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            zipAlignEnabled true
        }
    }

    //    packagingOptions {
    //        exclude 'META-INF/LICENSE.txt'
    //        exclude 'META-INF/NOTICE.txt'
    //    }
}

repositories {
    mavenCentral()
    maven() { url "https://oss.sonatype.org/content/repositories/snapshots" }
    maven { url 'https://maven.fabric.io/public' }
    maven { url "https://jitpack.io" }
    maven {
        url 'https://maven.google.com/'
        name 'Google'
    }
    jcenter()
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'lib')
    compile('com.github.worker8:tourguide:1.0.17-SNAPSHOT@aar') {
        transitive = true
    }
    // Required -- JUnit 4 framework
    compile files('libs/SimpleNLG-4.4.8.jar')
    compile files('libs/activation.jar')
    compile files('libs/additionnal.jar')
    compile files('libs/mail.jar')
    compile('com.crashlytics.sdk.android:crashlytics:2.6.5@aar') {
        transitive = true;
    }
    compile('com.github.worker8:tourguide:1.0.17-SNAPSHOT@aar') {
        transitive = true
    }
    // Optional -- Mockito framework
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:cardview-v7:26.1.0'
    implementation 'com.android.support:recyclerview-v7:26.1.0'
    implementation 'com.google.android.gms:play-services:11.8.0'
    implementation 'com.android.support:support-v4:26.1.0'
    implementation 'com.google.android.gms:play-services-analytics:11.8.0'
    implementation 'com.google.android.gms:play-services-location:11.8.0'
    implementation 'com.google.android.gms:play-services-auth:11.8.0'
    implementation 'com.android.support:customtabs:26.1.0'
    implementation 'junit:junit:4.12'
    implementation 'com.android.support:multidex:1.0.2'
    implementation 'com.google.firebase:firebase-storage:11.8.0'
    implementation 'com.google.firebase:firebase-auth:11.8.0'
    implementation 'com.google.firebase:firebase-database:11.8.0'
    implementation 'com.google.firebase:firebase-messaging:11.8.0'
    implementation 'io.github.kobakei:ratethisapp:1.2.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.mercadopago:sdk:3.7.2'
    implementation 'com.google.guava:guava:23.3-android'
    androidTestCompile 'com.android.support.test:runner:1.0.1'
    androidTestCompile 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation group: 'com.google.apis', name: 'google-api-services-translate', version: 'v2-rev48-1.22.0'
    implementation group: 'com.google.api-client', name: 'google-api-client-gson', version: '1.22.0'

    testCompile 'junit:junit:4.12'
    testCompile 'org.mockito:mockito-core:1.10.19'

    // Testing-only dependencies
    androidTestCompile 'com.android.support.test:runner:1.0.1'
    androidTestCompile 'com.android.support.test.espresso:espresso-core:3.0.1'
    compile('com.google.code.findbugs:jsr305:2.0.1')
}

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '25.3.0'
            }
        }
    }
}

apply plugin: 'com.google.gms.google-services'

还尝试禁用此实现'com.google.android.gms:play-services:11.8.0',也没有尝试。

1 个答案:

答案 0 :(得分:0)

尝试使用此内部依赖项

 compile ('com.google.dagger:dagger:2.4') {
        exclude group: 'com.google.guava'
    }