簡體   English   中英

運行應用程序時無法合並 Dex 錯誤

[英]Unable To Merge Dex Error While Running App

我正在嘗試運行我的 android 應用程序。 它之前工作正常。 可能是在新的更新的 gradle 中運行它后,我收到此錯誤

Error:java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
Error:java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
Error:com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
Error:com.android.dex.DexException: Multiple dex files define Lorg/intellij/lang/annotations/JdkConstants$CursorType;

嘗試清潔和重建項目。 每次我重建和每次運行時都會出現以下錯誤..

錯誤:任務 ':app:transformClassesWithMultidexlistForDebug' 的執行失敗。

java.io.IOException:無法寫入 [/PROJECT_LOCATION/app/build/intermediates/multi-dex/debug/componentClasses.jar](無法讀取 [/Applications/Android Studio.app/Contents/gradle/m2repository/ org/jetbrains/annotations/13.0/annotations-13.0.jar(;;;;;;**.class)](重復的 zip 條目 [annotations-13.0.jar:org/intellij/lang/annotations/Flow.class]) )

我的構建 Gradle 配置

compileSdkVersion 26
defaultConfig {
    applicationId "MY_ID"
    minSdkVersion 18
    targetSdkVersion 26
    versionCode 65
    versionName "5.5.38"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    multiDexEnabled true
    renderscriptTargetApi 14
    renderscriptSupportModeEnabled true

    vectorDrawables.useSupportLibrary = true
}

根據我的經驗,當您的模擬器/移動設備中的 dex 版本無法與新構建的版本無縫融合時, dexMerger問題往往會自行解決。

  1. 嘗試在您的移動設備/模擬器上刪除您的應用程序。 然后重新安裝。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM