2016-04-27 155 views
2

當我運行InstrumentationTest時,它的編譯失敗。錯誤消息: 錯誤:執行任務':app:transformClassesWithJarMergingForDebugAndroidTest'失敗。錯誤:任務執行失敗':app:transformClassesWithJarMergingForDebugAndroidTest'

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/test/InstrumentationRegistry.class Somebody tell me why?thank you for you notice

+0

支票庫或jar讓它重複並添加你的build.gradle – USKMobility

+0

沒有文件重複,只是錯過了我的build.gradle中的單詞:packagingOptions {'0'''''''排除'LICENSE.txt' } –

+0

此處有任何更新?我有同樣的問題,已經嘗試了不同的選項來排除AndroidTestCompile包,但似乎沒有工作。 –

回答

0

這只是錯過單詞的build.gradle:

packagingOptions { 
    exclude 'LICENSE.txt' 
} 

但是當我添加的那些話,建立失效過,並報告其他錯誤消息:

Error:Error converting bytecode to dex: 
Cause: com.android.dex.DexException: Multiple dex files define   Landroid/support/test/BuildConfig; 
Error:Execution failed for task ':app:transformClassesWithDexForDebugAndroidTest'. 
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_60\bin\java.exe'' finished with non-zero exit value 2 
相關問題