gpt4 book ai didi

java - Android:错误:任务 ':app:transformClassesWithJarMergingForFlavorDebug' 执行失败

转载 作者:行者123 更新时间:2023-11-29 02:37:56 29 4
gpt4 key购买 nike

您好,我在 Android Studio 中遇到以下错误..

 Error:Execution failed for task
':app:transformClassesWithJarMergingForFlavorDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry:
com/google/zxing/aztec/AztecDetectorResult.class

项目运行良好,但我不知道为什么它开始出现此异常。我没有更改 gradle 文件中的任何内容。

gradle 文件:

apply plugin: 'com.android.application'
android {
signingConfigs {
config {
keyAlias 'Project'
keyPassword 'password'
storeFile file('./../project/project.keystore')
storePassword 'password'
}
}
compileSdkVersion 25
buildToolsVersion '25.0.2'
useLibrary 'org.apache.http.legacy'
lintOptions {
checkReleaseBuilds false
}
dexOptions {
jumboMode = true
javaMaxHeapSize "4g"
}
defaultConfig {
applicationId "com.project.project"
minSdkVersion 15
targetSdkVersion 25
versionCode 38
versionName "2.1.0"
multiDexEnabled true
signingConfig signingConfigs.config
}
buildTypes {
release {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
debug {
signingConfig signingConfigs.config
}
}
productFlavors {
flavor {
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile files('libs/AndroidSwipeLayout-v1.1.8.jar')
compile files('libs/commons-codec-1.3.jar')
compile files('libs/httpmime-4.3.5.jar')
compile files('libs/linkedin-j-android.jar')
compile files('libs/localytics.jar')
compile files('libs/picasso-2.5.2.jar')
compile files('libs/retrofit-1.9.0.jar')
compile files('libs/twitter4j-core-4.0.1.jar')
compile files('libs/universal-image-loader-1.9.3.jar')
compile files('libs/zxing-2.1.jar')
compile files('libs/bolts-android-1.1.2.jar')
compile('com.facebook.android:facebook-android-sdk:[4,5)') {
exclude module: 'bolts-android'
exclude module: 'com.android.support:support-v4:23.0.3'
}
// compile 'com.kbeanie:image-chooser-library:1.6.0@aar'
// compile 'com.kbeanie:image-chooser-library:1.5.8@aar'
compile files('libs/isoparser-1.0-RC-27.jar')
compile files('libs/aspectjrt-1.8.7.jar')
compile project(':image-chooser-library')
compile 'com.google.code.gson:gson:2.7'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.google.android.gms:play-services-auth:10.2.1'
compile 'com.google.android.gms:play-services-gcm:10.2.1'
compile 'com.google.android.gms:play-services-plus:10.2.1'
compile 'com.appsflyer:af-android-sdk:4.+@aar'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'com.squareup.okhttp3:okhttp:3.4.1'
compile 'javax.media:jmf:2.1.1e'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}

我正在使用;

Windows 8.1 pro, Android Studio 2.3.3

到目前为止我尝试了什么;

  1. Clean Build Rebuild
  2. gradlew clean
  3. Delete Both build folders

没有效果

有人可以帮助我吗..如果需要任何其他信息,请告诉我

更新信息:在不改变任何东西的情况下在模拟器上工作,但在我的手机上却没有,即使它也在它上面工作

最佳答案

尝试将其添加到您应用的 build.gradle 依赖项中:

compile('com.google.zxing:core:2.1') {
exclude group: 'com.google.zxing'
}

并删除这一行:

compile files('libs/zxing-2.1.jar')

关于java - Android:错误:任务 ':app:transformClassesWithJarMergingForFlavorDebug' 执行失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45914142/

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