其他分享
首页 > 其他分享> > TransformClassesWithJarMergingForRelease Android

TransformClassesWithJarMergingForRelease Android

作者:互联网

你好每个人我有一个问题生成与android工作室签署的apk.

我在这方面搜索了很多,但在我的情况下找不到工作的解决方案,我知道这是与重复的类输入相关的问题但是任何人都可以告诉我哪些我需要排除.

我尝试跟随的东西,但那不起作用.

 {
    exclude group: 'com.payu.custombrowser', module: 'customBrowser'
 }

这是生成签名apk时我得到的错误

Error:Execution failed for task
‘:transformClassesWithJarMergingForRelease’.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/payu/custombrowser/BuildConfig.class

以下是我的build.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"

useLibrary 'org.apache.http.legacy'

defaultConfig {
    applicationId "company.app.appname"
    minSdkVersion 9
    targetSdkVersion 23
    multiDexEnabled true

}

aaptOptions {
    useNewCruncher false
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        zipAlignEnabled true
    }
}
}

dependencies {

compile 'com.android.support:multidex:1.0.1'

compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':hellochartslibrary')
compile project(':customBrowser')
compile project(':facebook')


compile 'com.android.support:support-v4:23.3.0'
compile 'com.google.code.gson:gson:2.4'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.android.support:appcompat-v7:23.3.0'

我不知道我要排除什么以解决这个问题,有人知道请帮助我.

EDIT NOTE:

If i directly run the app means without generate signed apk than its work fine there is no error log but it show me only when i’m trying to generate signed apk

解决方法:

您已经使用compileTree指令引用那些jar文件,因此可能不需要所有这些编译文件条目.

此外,编译’com.google.android.gms:play-services:8.4.0′,你包括整个Play服务,有一些模块化版本可能有助于首先避免MultiDex.

标签:android,apk,signed,android-multidex,payu
来源: https://codeday.me/bug/20190706/1395797.html