相关疑难解决方法(0)

错误:程序类型已存在:android.support.design.widget.CoordinatorLayout $ Behavior

我在构建项目时遇到以下错误.在这个项目中没有使用CoordinatorLayout.刚刚在build.gradle中添加为依赖项:

我使用的是Android Studio 3.2 Canary 4.

logcat的

AGPBI:{"kind":"error","text":"程序类型已存在:android.support.design.widget.CoordinatorLayout $ Behavior","sources":[{}],"tool":"D8" }:app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED FAILURE:构建因异常而失败.*出了什么问题:任务执行失败':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.

com.android.builder.dexing.DexArchiveMergerException:合并dex存档时出错:/windows/Other/app/build/intermediates/transforms/dexBuilder/debug/0.jar,/ windows/Other/app/build/intermediates/transforms/dexBuilder/debug/1.jar,/windows/Other/app/build/intermediates/transforms/dexBuilder/debug/4.jar,.....................

/windows/Other/app/build/intermediates/transforms/dexBuilder/debug/294.jar

程序类型已存在:android.support.design.widget.CoordinatorLayout $ Behavior

的build.gradle

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.3"
    defaultConfig {
        applicationId "com.dagkot"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            buildConfigField "String", "BASE_URL", "\"http://api.openweathermap.org/data/2.5/\""
            buildConfigField "String", "API_KEY", "\"435e9075f348868c2714fe7c6895efa5\""
        }
        debug {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        buildConfigField "String", …
Run Code Online (Sandbox Code Playgroud)

android kotlin dagger-2 android-coordinatorlayout

127
推荐指数
9
解决办法
17万
查看次数