当前位置: 首页 > 知识库问答 >
问题:

flutter清理后执行com.android.build.gradle.internal.tasks.workers$ActionFacade时出错

那宏大
2023-03-14
Running Gradle task 'assembleDebug'...
java.nio.file.NoSuchFileException: C:\Users\nobit\AndroidStudioProjects\Production\secret_keeper\build\app\intermediates\external_file_lib_dex_archives\debug\out
        at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:79)
        at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
        at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
        at sun.nio.fs.WindowsDirectoryStream.<init>(WindowsDirectoryStream.java:80)
        at sun.nio.fs.WindowsFileSystemProvider.newDirectoryStream(WindowsFileSystemProvider.java:522)
        at java.nio.file.Files.newDirectoryStream(Files.java:457)
        at java.nio.file.Files.list(Files.java:3451)
        at com.android.build.gradle.internal.tasks.DexMergingParams.getAllDexFiles(DexMergingTask.kt:502)
        at com.android.build.gradle.internal.tasks.DexMergingTaskRunnable.run(DexMergingTask.kt:423)
        at com.android.build.gradle.internal.tasks.Workers$ActionFacade.run(Workers.kt:335)
        at org.gradle.workers.internal.AdapterWorkAction.execute(AdapterWorkAction.java:50)
        at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:47)
        at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1$1.create(NoIsolationWorkerFactory.java:65)
        at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1$1.create(NoIsolationWorkerFactory.java:61)
        at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:98)
        at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.execute(NoIsolationWorkerFactory.java:61)
        at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44)
        at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
        at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)
        at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:56)
        at org.gradle.workers.internal.DefaultWorkerExecutor$3.call(DefaultWorkerExecutor.java:215)
        at org.gradle.workers.internal.DefaultWorkerExecutor$3.call(DefaultWorkerExecutor.java:210)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:215)
        at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:164)
        at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:131)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
        at java.lang.Thread.run(Thread.java:748)


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDexDebug'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > java.nio.file.NoSuchFileException: C:\Users\nobit\AndroidStudioProjects\Production\secret_keeper\build\app\intermediates\external_file_lib_dex_archives\debug\out

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 36s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done                       163.3s (!)
Exception: Gradle task assembleDebug failed with exit code 1

在运行flutter clean之后得到了这个异常,在clean之前它是工作的,但是在clean之后它显示了这个异常。

扑动博士-V

[√]Flutter(通道稳定,1.22.5,在Microsoft Windows上[版本10.0.19041.685],现场进入)•Flutter版本1.22.5,在C:\flutterSDK\Flutter•框架修订版7891006299(4周前)2020-12-10 11:54:40-0800•引擎修订版ae90085a84•Dart版本2.10.4

[√]Android toolchain-为Android设备开发(Android SDK版本30.0.2)•Android SDK在C:\Users\Nobit\AppData\Local\Android\SDK•平台android-30,构建工具30.0.2•Java二进制在:C:\Program Files\Android\Android Studio\JRE\bin\Java•Java版OpenJDK运行时环境(build 1.8.0_242-Release-1644-B01)•接受所有Android许可。

[!]Android Studio(4.1.0版)•Android Studio at C:\程序文件\Android\Android Studio X Flutter插件未安装;这增加了Flutter特定的功能。X未安装Dart插件;这增加了Dart特定的功能。•Java版OpenJDK运行时环境(build 1.8.0_242-Release-1644-B01)

[√]VS Code(版本1.51.1)•VS Code at C:\Users\Nobit\AppData\Local\Programs\Microsoft VS Code•Flutter扩展版本3.16.0

[√]连接设备(1个可用)•vivo Y21L(移动)•c98e68ea•android-arm•Android 5.1.1(API 22)

!医生在1个类别中发现问题。

共有1个答案

钱浩荡
2023-03-14

问题出在multidex Builder上。

转到android/app/build.gradle并添加以下代码行:

dependencies {
  implementation "androidx.multidex:multidex:2.0.1"
}
android {
    defaultConfig {
        multiDexEnabled true
    }
}
 类似资料: