1. 程式人生 > >安卓中執行報錯Error:Execution failed for task ':app:transformClassesWithDexForDebug'解決

安卓中執行報錯Error:Execution failed for task ':app:transformClassesWithDexForDebug'解決

錯誤如下:Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.

> java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

開啟project目錄,我的app中自帶有android_support_v7.xml,表明它是支援v7的,這是預設的,肯定有



我又在build.gradle中再次配置了android_support_v7(重複匯入v7包了)。

解決辦法:

將libs中的v7包刪除,重新clean一下,run執行一下 ,就可以了~~

問題解決了,總結就是一定有重複的引用library或者jar包。