Обновление библиотек com.android.support v7: 26. + до v7: 28.0.0 throw Несколько файлов dex определяют Lcom / google / common / util / concurrent / ListenableFuture - PullRequest
0 голосов
/ 19 января 2019

Я пытаюсь обновить зависимости с v: 7: 26. + до v: 7.28.0.0, синхронизация в порядке, но при попытке запустить приложение выдается ошибка множественной дешифровки, я не уверен, на что он жалуется Попытался обновить мультидекс зависимость с 1.0.1 до 1.0.3, но это не помогает. Пожалуйста, помогите!

Ошибка: определено несколько файлов dex Lcom / Google / общие / Util / параллельный / ListenableFuture;

Мой App Gradle

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

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.myapp.findme"
        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:28.0.0'

    //implementation 'com.google.android.material:material:1.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'

    //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'

    /**
     * https://github.com/JakeWharton/butterknife
     * Avoid findViewById calls by using @BindView on field
     * note: cannot go to 10.10.0, require min sdk 26
     */
    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
    //implementation 'com.android.support:multidex:1.0.1'
    implementation 'com.android.support:multidex:1.0.3'

    // 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)'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.android.volley:volley:1.1.0'
    implementation 'com.google.code.gson:gson:2.8.2'

    // for BLE

    //implementation 'org.altbeacon:android-beacon-library:2.15+'

    //implementation 'org.altbeacon:android-beacon-library:2.15.2'
    compile(name: 'android-beacon-library-more-reliable-service-stop2-1-g7dbb6b3', ext: 'aar')

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

    // *** Jetpack ***

    //

    // 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)
    implementation '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
    implementation 'org.apache.commons:commons-lang3:3.4'

}

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

Мой проект gradle

buildscript {

    repositories {
        google()
        jcenter()
        maven {
            url "https://maven.google.com"
        }
        maven {
            // for crashlytics
            url 'https://maven.fabric.io/public'

        }
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.1'
        //classpath 'com.google.gms:google-services:3.1.0'
        classpath 'com.google.gms:google-services:4.0.1' // google-services plugin
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files

        // for crashlytics
        classpath 'io.fabric.tools:gradle:1.25.4'

    }
}



allprojects {
    repositories {
        google()
        jcenter()

        // for crashlytics
        maven {
            url 'https://maven.google.com/'
        }

        flatDir {
            dirs 'src/main/libs'
        }

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

1 Ответ

0 голосов
/ 19 января 2019

Решение : Исключение группы Guava с listenablefuture модулем из текущей транзитивной зависимости

implementation("android.arch.work:work-runtime:1.0.0-alpha09") {
    exclude group: 'com.google.guava', module: 'listenablefuture' 
}

Также используйте эту конфигурацию для linkedin-sdk:

api project(path: ':linkedin-sdk') {
    transitive = true
}

Причина :

Согласно Google Issue Tracker ,

Это удивительно сделано специально!( ссылка ) Тем не менее, скоро будет доступна новая версия Guava, что, конечно, решит проблему.На данный момент исключение, как указано выше, должно работать отлично.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...