android開發解決Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'. > java.lang.RuntimeException: java.lang.RuntimeException: c.....


網上常見的方法我都試過,都沒能解決,偶然看到的一個方法解決了,在這了記錄一下。

在App目錄下的build.gradle的android{ ...  ....}中添加如下代碼,即可解決。(xx.xx.xx是運行項目的版本號)

configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion 'xx.xx.xx'
}
}
}
}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM