Android, включая дизайн материала, вызывает ошибку Multiple Dex - PullRequest
0 голосов
/ 13 января 2019

Я пытаюсь включить implementation 'com.google.android.material:material:1.0.0' в файл gradle приложения и "Синхронизировать сейчас" без проблем, но при попытке запустить приложение выдается сообщение об ошибке:

Multiple dex files define Lcom/google/common/util/concurrent/ListenableFuture;

Я пробовал так много вещей, но все еще не смог решить проблему, пожалуйста, помогите!

Вот мой файл Gradle:

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.camp.myapp"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    buildToolsVersion '28.0.3'

    // Temporary fix until alpha10
    packagingOptions {
        exclude 'META-INF/proguard/androidx-annotations.pro'
    }
}


dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.+'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:design:26.+'
    implementation 'com.android.support:cardview-v7:26.+'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    compile 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
    compile 'com.android.support:multidex:1.0.1'

    // for firebase and firestore
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.firebase:firebase-firestore:17.0.4'
    implementation 'com.google.firebase:firebase-auth:16.0.2'
    implementation 'com.google.firebase:firebase-messaging:17.3.0'
    implementation 'com.firebase:firebase-jobdispatcher:0.8.5'

    // for LinkedIn
    compile project(path: ':linkedin-sdk')

    // for facebook
    implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'de.hdodenhof:circleimageview:2.2.0'
    compile 'com.android.volley:volley:1.1.0'
    compile 'com.google.code.gson:gson:2.8.2'

    compile(name: 'android-beacon-library-more-reliable-service-stop2-1-g7dbb6b3', ext: 'aar')

    // life cycle
    compile 'android.arch.lifecycle:extensions:1.0.0'
    annotationProcessor "android.arch.lifecycle:compiler:1.0.0"

    // Release note https://developer.android.com/jetpack/docs/release-notes

    // for ROOM
    implementation 'com.amitshekhar.android:debug-db:1.0.4'
    def room_version = "1.1.1"
    implementation "android.arch.persistence.room:runtime:$room_version"
    annotationProcessor "android.arch.persistence.room:compiler:$room_version"

    // for work manager
    def work_version = "1.0.0-alpha09"
    implementation "android.arch.work:work-runtime:$work_version"

    // *** End of JackPack ***

    // for google play service (location)
    compile 'com.google.android.gms:play-services-location:15.0.1'

    // for google login
    implementation 'com.google.android.gms:play-services-auth:15.0.1'

    // for fire storage
    implementation 'com.google.firebase:firebase-storage:16.0.1'

    // for image
    //implementation 'com.android.support:exifinterface:27.1.1'
    implementation 'com.android.support:exifinterface:28+'


    // for crashlytics
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'

    // for bugfender
    implementation 'com.bugfender.sdk:android:1.+'

    // userful method
    compile 'org.apache.commons:commons-lang3:3.4'

    implementation 'com.google.android.material:material:1.0.0'

}

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