gpt4 book ai didi

java - 构建项目时无法合并 dex 运行和重复条目

转载 作者:行者123 更新时间:2023-12-02 11:18:23 24 4
gpt4 key购买 nike

这是我的 build.gradle

当我构建项目时出现此错误:

Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug'. java.io.IOException: Can't write [D:\Dev\android\fruit\Fruit\app\build\intermediates\multi-dex\debug\componentClasses.jar] (Can't read [C:\Users\bahrani.gradle\caches\transforms-1\files-1.1\support-core-ui-27.1.1.aar\7c83800d6960afec35a787899d518156\jars\classes.jar(;;;;;;**.class)] (Duplicate zip entry [classes.jar:android/support/design/widget/CoordinatorLayout$Behavior.class]))

当我运行项目时出现此错误:

Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'. com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

apply plugin: 'com.android.application'

android {
compileSdkVersion 27
buildToolsVersion "27.0.2"
defaultConfig {
applicationId "pinuit.app.ir.fruit"
minSdkVersion 17
targetSdkVersion 27
multiDexEnabled true
versionCode 3
versionName "1.7"
manifestPlaceholders = [onesignal_app_id : "222c377a-7695-433c-b6a0-4edd3cd79771",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
repositories {
mavenCentral()
}
}

dependencies {
compile ('com.android.support.constraint:constraint-layout:1.0.2'){
exclude group: 'com.android.support', module:'support-v4'
}
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile ('com.android.support:support-v4:27.0.2') {
exclude group: 'com.android.support', module:'support-v4'
}
compile ('com.android.support:appcompat-v7:27.0.2') {
exclude group: 'com.android.support', module:'support-v4'
}
compile ('com.android.support:cardview-v7:27.0.2') {
exclude group: 'com.android.support', module:'support-v4'
}
compile ('com.android.support:recyclerview-v7:27.0.2') {
exclude group: 'com.android.support', module:'support-v4'
}
compile ('com.android.support:design:27.0.2') {
exclude group: 'com.android.support', module:'support-v4'
}
implementation 'it.sephiroth.android.library.bottomnavigation:bottom-navigation:2.0.1-rc1'
implementation 'com.wang.avi:library:2.1.3'
implementation('com.squareup.retrofit2:retrofit:2.1.0') {
exclude module: 'okhttp'
}
implementation 'com.squareup.okhttp3:okhttp:3.4.1'
implementation 'com.squareup.retrofit2:converter-gson:+'
implementation 'com.squareup.okhttp3:logging-interceptor:3.3.1'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'jp.wasabeef:glide-transformations:2.0.0'
implementation 'com.onesignal:OneSignal:[3.8.3, 3.99.99]'
implementation 'com.google.firebase:firebase-core:12.0.1'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.daimajia.slider:library:1.1.5@aar'
}


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

最佳答案

当我尝试将 Unity3D 项目导入 Android Studio 时,我看到了类似的错误。首先,我将“编译”更改为“实现”,请参阅下面的链接

https://stackoverflow.com/a/47304057/8634987

就我而言,我尝试导入多个 .aar 文件,我发现此错误的解决方案是将所有 .aar 文件单独导入为库。希望这会有所帮助

关于java - 构建项目时无法合并 dex 运行和重复条目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50104412/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com