TransformClassesWithJarMergingForRelease Android

时间:2016-04-16 07:14:04

标签: android apk signed android-multidex payu

大家好我在使用android studio生成签名的apk时遇到了一个问题。

我已经对此进行了大量搜索,但在我的案例中找不到合适的解决方案,我知道这是与重复课程录入有关的问题但是有人可以告诉我哪些需要排除。

我尝试关注的事情,但这不起作用。

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

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

  

错误:任务执行失败   ':transformClassesWithJarMergingForRelease'

     

com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目: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'

我不知道我必须排除什么才能解决这个问题,有人知道请帮助我。

  

编辑注:

     

如果我直接运行应用程序意味着没有生成签名的apk比它的工作正常没有错误日志但它只显示我正在尝试生成签名的apk

1 个答案:

答案 0 :(得分:1)

您已经使用compileTree指令引用了这些jar文件,因此可能不需要所有这些compile files条目。

另外,compile 'com.google.android.gms:play-services:8.4.0',您包括整个Play服务,其中有模块化版本可能有助于首先避免使用MultiDex。

相关问题