android开发:release打包Error:Execution failed for task ':app:transformClassesWithJarMergingForRelease'.
程序员文章站
2022-04-24 22:40:18
...
情景
项目进行release打包,结果报错:
Error:Execution failed for task ':app:transformClassesWithJarMergingForRelease'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/widget/ViewDragHelper$Callback.class
解决
开始百度上寻找解决方法,几乎都是说,这是项目依赖包存在相同的包,类。解决的方法是,删除重复的JAR包。但是我的项目,没有相同的JAR包。
折磨了半天,最后解决了这问题,更新一下app目录下的grade文件的v4,v7的版本,设置成一致,然后release打包成功了。
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.smart.smartguanggangproject"
minSdkVersion 19
targetSdkVersion 25
multiDexEnabled true
}
buildTypes {
release {
// minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.zhy:base-rvadapter:3.0.3'
}
上一篇: hibernate3 注释生成复合主键或者嵌入式主键的方法及实例
下一篇: (retrofit2报错)java.lang.IllegalArgumentException: Missing either @GET URL or @Url parameter.
推荐阅读
-
ANDROID打包错误ERROR:EXECUTION FAILED FOR TASK ′:APP:LINTVITALRELEASE′.
-
关于android studio打开后自动弹出:Error:Execution failed for task ':app:preDebugAndroidTestBuild'
-
Android Studio Error:Execution failed for task ':app:preDebugAndroidTestBuild'.彻底解决的方法以及修改AScompileSDKVersion
-
Android:Error:Execution failed for task ':app:clean'. > Unable to del
-
Android studio Error:Execution failed for task ':app:preDebugAndroidTestBuild'错误的解决办法
-
android studio新建项目时出现Error:Execution failed for task ':app:preDebugAndroidTestBuild'.
-
ANDROID打包错误ERROR:EXECUTION FAILED FOR TASK ′:APP:LINTVITALRELEASE′.
-
关于android studio打开后自动弹出:Error:Execution failed for task ':app:preDebugAndroidTestBuild'
-
android开发:release打包Error:Execution failed for task ':app:transformClassesWithJarMergingForRelease'.
-
android studio 出现Error:Execution failed for task ':app:preDebugAndroidTestBuild'. 的解决办法