首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Android API 28更新后,正在获取:合并dex存档时出错

Android API 28更新后,正在获取:合并dex存档时出错
EN

Stack Overflow用户
提问于 2018-08-21 09:32:08
回答 1查看 2.4K关注 0票数 3

我正在尝试将我的Android应用程序迁移到API 28 (Android 9/P)

我得到了5个我不能修复的错误,我仍然是Android开发的新手,我想,我可能没有最好的更新方法。

我已经尝试过清理和重建,但问题仍在发生。

这是我的gradle项目:

代码语言:javascript
复制
buildscript {
    ext.kotlin_version = '1.2.61'

    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.google.gms:google-services:4.1.0'
        classpath 'com.android.tools.build:gradle:3.1.4'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'io.realm:realm-gradle-plugin:5.4.2'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

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

下面是我的应用gradle:

代码语言:javascript
复制
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'realm-android'

android {

    lintOptions {
        checkReleaseBuilds false
    }

    compileSdkVersion 28
    defaultConfig {
        applicationId "org.siku.siku"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 118
        versionName "1.0.3"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

        multiDexEnabled true //important
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude module: 'support-annotations'
    })

    implementation 'com.google.firebase:firebase-auth:16.0.3'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.google.android.material:material:1.0.0-rc01'
    implementation 'androidx.appcompat:appcompat:1.0.0-rc01'
    implementation 'androidx.legacy:legacy-support-core-ui:1.0.0-rc01'
    implementation 'androidx.core:core-ktx:1.0.0-rc01'
    implementation 'androidx.exifinterface:exifinterface:1.0.0-rc01'
    implementation 'androidx.vectordrawable:vectordrawable:1.0.0-rc01'
    implementation 'androidx.cardview:cardview:1.0.0-rc01'
    implementation 'androidx.browser:browser:1.0.0-rc01'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.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.android.gms:play-services-auth:16.0.0'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'com.amitshekhar.android:android-networking:1.0.2'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'joda-time:joda-time:2.9.9'
    implementation 'info.hoang8f:android-segmented:1.0.6'
    implementation 'io.nlopez.smartlocation:library:3.3.3'
    implementation 'com.facebook.android:facebook-android-sdk:4.35.0'
    implementation files('libs/CircleImageView-master/gradle/wrapper/gradle-wrapper.jar')
    implementation 'org.greenrobot:eventbus:3.1.1'
    testImplementation 'org.mockito:mockito-core:2.8.9'
    testImplementation 'junit:junit:4.12'
    debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4'
    releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'
}

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

repositories {
    mavenCentral()
    google()
}

我收到5个错误:

1-程序类型已存在: android.support.customtabs.ICustomTabsCallback

2-由:合并dex存档时出现com.android.builder.dexing.DexArchiveMergerException:错误: java.lang.RuntimeException:

3-由:合并dex归档时出现com.android.builder.dexing.DexArchiveMergerException:错误:

4-原因: com.android.tools.r8.CompilationFailedException:编译无法完成

5-原因: com.android.tools.r8.utils.AbortException

我一直在努力寻找关于这个问题的文档。对文档的任何建议或链接都将不胜感激。

EN

回答 1

Stack Overflow用户

发布于 2018-08-27 21:07:12

也许您忘记了这一点:依赖项中的implementation 'com.android.support:multidex:1.0.3'

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51940442

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档