FLUTTER,Gradle任务assembleDebug失败,退出代码为1

时间:2019-11-12 21:14:57

标签: android android-studio flutter sdk androidx

  • 当我编译它时,会出现此错误,*帮帮我。

    '''D8:程序类型已存在:io.flutter.BuildConfig com.android.builder.dexing.DexArchiveMergerException:合并dex归档文件时出错: 在https://developer.android.com/studio/build/dependencies#duplicate_classes了解如何解决该问题。 程序类型已经存在:io.flutter.BuildConfig     在com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:131)     在com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:118)     在com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:102)     在com.android.build.gradle.internal.tasks.DexMergingTaskRunnable.run(DexMergingTask.kt:444)     在com.android.build.gradle.internal.tasks.Workers $ ActionFacade.run(Workers.kt:335)     在org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:39)     在org.gradle.workers.internal.NoIsolationWorkerFactory $ 1 $ 1.execute(NoIsolationWorkerFactory.java:61)     在org.gradle.workers.internal.AbstractWorker $ 1.call(AbstractWorker.java:44)     在org.gradle.workers.internal.AbstractWorker $ 1.call(AbstractWorker.java:41)     在org.gradle.internal.operations.DefaultBuildOperationExecutor $ CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)     在org.gradle.internal.operations.DefaultBuildOperationExecutor $ CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)处     在org.gradle.internal.operations.DefaultBuildOperationExecutor $ 1.execute(DefaultBuildOperationExecutor.java:165)     在org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)处     在org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)     在org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)     在org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)     在org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)     在org.gradle.workers.internal.NoIsolationWorkerFactory $ 1.execute(NoIsolationWorkerFactory.java:55)     在org.gradle.workers.internal.DefaultWorkerExecutor $ 1.call(DefaultWorkerExecutor.java:105)     在org.gradle.workers.internal.DefaultWorkerExecutor $ 1.call(DefaultWorkerExecutor.java:99)     在java.util.concurrent.FutureTask.run(FutureTask.java:266)     在org.gradle.internal.work.DefaultConditionalExecutionQueue $ ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:215)处     在org.gradle.internal.work.DefaultConditionalExecutionQueue $ ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:164)     在org.gradle.internal.work.DefaultConditionalExecutionQueue $ ExecutionRunner.run(DefaultConditionalExecutionQueue.java:131)     在java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:511)     在java.util.concurrent.FutureTask.run(FutureTask.java:266)     在org.gradle.internal.concurrent.ExecutorPolicy $ CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)     在org.gradle.internal.concurrent.ManagedExecutorImpl $ 1.run(ManagedExecutorImpl.java:46)     在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)     在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:624)     在org.gradle.internal.concurrent.ThreadFactoryImpl $ ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)     在java.lang.Thread.run(Thread.java:748) 引起原因:com.android.tools.r8.CompilationFailedException:编译无法完成     在com.android.tools.r8.utils.t.a(:55)     在com.android.tools.r8.D8.run(:11)     在com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:116)     ...另外30个 引起原因:com.android.tools.r8.utils.AbortException:错误:程序类型已存在:io.flutter.BuildConfig     在com.android.tools.r8.utils.Reporter.a(:21)     在com.android.tools.r8.utils.Reporter.a(:7)     在com.android.tools.r8.utils.t.a(:36)     ...另外32个

    完成错误:Gradle任务assembleDebug失败,退出代码为1'''

1 个答案:

答案 0 :(得分:1)

  • 请确保没有立即运行此应用程序。和/或尝试卸载应用程序(如果以前已安装过)。

  • 尝试重命名/减少程序包名称。出于测试目的,我记得它是由于命名问题而发生的。