2016-04-16 16 views
4

大家好我有一个关于生成android studio签名的apk的问题。TransformClassesWithJarMergingForRelease Android

我对此有很多搜索,但在我的案例中找不到工作解决方案,我知道这是与重复类输入相关的问题,但任何人都可以告诉我需要排除哪些问题。

我尝试下面的事情,但那是行不通的。

{ 
    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

+0

尝试运行一个干净的版本。 http://stackoverflow.com/questions/33209631/errorexecution-failed-for-task-apptransformclasseswithjarmergingfordebug – razzledazzle

回答

1

你已经提到这些jar文件与compileTree指令,因此可能并不需要所有这些compile files条目。

此外,您还包括整个Play服务,这些模块化版本可能有助于首先避免使用MultiDex。

+0

删除所有罐子的依赖关系,并删除与项目重建的分析依赖项仍然发生同样的错误家伙任何事情我可以做什么?我在您的建议后尝试编辑我的问题并尝试 –

+0

错误已在'customBrowser'模块中检测到一些重复。检查它是否已经包含在jar中,或者检查模块本身。 – razzledazzle

+0

该模块自定义浏览器只使用它的罐子,所以我无法检测或排除重复条目希望任何payu人帮我解决这个问题,因为我尝试通过payu的会计解决它,但没有得到任何帮助 –

相关问题