您能帮我解决Android Studio中的此错误吗?
我正在使用新的WorkManager库版本,并且在Android Studio中出现以下错误,您可以帮我吗?
org.gradle.api.tasks.TaskExecutionException: Execution failed for task
':app:transformDexArchiveWithExternalLibsDexMergerForDebug'. at
org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
at
org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
at
...
at java.lang.Thread.run(Thread.java:745) Caused by:
java.lang.RuntimeException: java.lang.RuntimeException:
com.android.builder.dexing.DexArchiveMergerException: Unable to merge
dex . . . Caused by: com.android.dex.DexException: Multiple dex files
define Lcom/google/common/util/concurrent/ListenableFuture;
答案 0 :(得分:0)
将此添加到您的应用程序级别build.gradle:
dependencies {
compile 'com.android.support:multidex:1.0.3' // ADD THIS LINE
// rest of your dependencies
}
,这在您的defaultConfig中:
defaultConfig {
...
minSdkVersion 15
targetSdkVersion 26
multiDexEnabled true // ADD THIS LINE
}
您可以在此处了解更多信息:Enable Multidex for apps with more than 64k methods