我在嘗試生成android studio上簽名的apk時收到錯誤。研究表明,我需要將模塊排除在其中一個編譯的jar文件中。但我無法分辨哪一個需要排除。
The following is my list of dependancies
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.onesignal:OneSignal:[email protected]'
compile files('libs/antlr-runtime-3.2.jar')
compile files('libs/ical4j-1.0.2.jar')
compile files('libs/jsoup-1.8.1.jar')
compile files('libs/listviewanimations_lib-core-slh_3.1.0.jar')
compile files('libs/listviewanimations_lib-core_3.1.0.jar')
compile files('libs/listviewanimations_lib-manipulation_3.1.0.jar')
compile files('libs/natty-0.7.jar')
compile files('libs/nineoldandroids-2.4.0.jar')
compile files('libs/universal-image-loader-1.9.3.jar')
compile files('libs/YouTubeAndroidPlayerApi.jar')
compile files('libs/commons-io-2.5.jar')
compile project(':hijriCalendarLibrary')
compile 'com.android.support:design:25.3.0'
testCompile 'junit:junit:4.12'
compile ('com.android.support:appcompat-v7:25.3.0'){
exclude module: 'support-v4'
}
compile 'com.google.android.gms:play-services-gcm:10.2.1'
compile 'com.google.android.gms:play-services-location:10.2.1'
compile 'com.google.android.gms:play-services-analytics:10.2.1'
compile 'com.google.android.gms:play-services-ads:10.2.1'
compile 'com.android.support:support-v4:25.3.0'
compile 'com.android.support:recyclerview-v7:25.3.0'
compile 'com.bignerdranch.android:expandablerecyclerview:1.0.3'
testCompile 'junit:junit:4.12'
}
這是收到完整的錯誤:
* What went wrong:
Execution failed for task ':app:transformClassesWithJarMergingForRelease'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/onesignal/ActivityLifecycleHandler$1.class
如何糾正呢?