build.gradle

аюсь использовать WorkManager из компонентов архитектуры. Я обновил compileSdkVersion и targetSdkVersion с 27 до 28. Успешная синхронизация завершена. Но ошибка времени сборки продолжает появляться. Библиотеки android.support используют версию 28.0.0-rc02 из-за 'android.support:design'.

Я пытался добавить packageOptions, чтобы исключить 'proguard / androidx-annotations.pro'. Но это не помогло. Но на этот раз я получил другое сообщение об ошибке:

Program type already present: com.google.common.util.concurrent.ListenableFuture

Я не мог понять, что происходит не так.

build.gradle:

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

apply plugin: 'io.fabric'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.apps.test"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 5
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }

    signingConfigs {
        release
    }

    buildTypes {
        release {
            signingConfig signingConfigs.release

            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            resValue "bool", "enableFirebase", "true"

        }
        debug {
            minifyEnabled false
            resValue "bool", "enableFirebase", "false"

        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
//    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:design:28.0.0-rc02'
    implementation 'com.android.support:recyclerview-v7:28.0.0-rc02'
    implementation 'com.android.support:support-v4:28.0.0-rc02'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:multidex:1.0.3'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation 'com.google.android.gms:play-services-location:15.0.1'
    implementation 'com.google.firebase:firebase-core:16.0.3'
    implementation 'com.google.firebase:firebase-auth:16.0.3'
    implementation 'com.google.android.gms:play-services-auth:16.0.0'
    implementation 'com.google.firebase:firebase-firestore:17.1.0'
    implementation 'com.firebaseui:firebase-ui-firestore:4.1.0'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'

    //Arch
    implementation 'android.arch.core:runtime:1.1.1'
    implementation 'android.arch.core:common:1.1.1'
    implementation 'com.google.code.gson:gson:2.8.5'

    implementation "android.arch.work:work-runtime-ktx:1.0.0-alpha09"
//    implementation "android.arch.work:work-firebase:1.0.0-alpha09"
}

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

РЕДАКТИРОВАТЬ: я реализовал параметры упаковки в Gradleкак здесь

packagingOptions {
    exclude 'META-INF/proguard/androidx-annotations.pro'
}

Но на этот раз я получил 5 дополнительных ошибок:

1:

Program type already present: com.google.common.util.concurrent.ListenableFuture
Message{kind=ERROR, text=Program type already present: com.google.common.util.concurrent.ListenableFuture, sources=[Unknown source file], tool name=Optional.of(D8)}

2:

Caused by: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: ...

3:

Caused by: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: ...

4:

Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete

5:

Caused by: com.android.tools.r8.utils.AbortException

Ответы на вопрос(3)

Ваш ответ на вопрос