在构建我的应用程序时,Gradle调用失败,同时运行应用程序时出现以下错误:transformDexWithInstantRunSlicesApkForDeBUG任务作为应用程序集的一部分.我不知道为什么会这样.我如何解决它?
我正在使用Gradle 5.1.1.
java.lang.RuntimeException: java.lang.RuntimeException:java.io.fileNotFoundException:F:\AndroID\KNowtrend2\app\build\intermediates\instant_run_split_apk_resources\deBUG\instantRunSplitApkResourcesDeBUG\out\slice_3\resources_ap at sun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeMethod) atsun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) atsun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) atjava.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:593) atjava.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:677) at java.util.concurrent.ForkJoinTask.join(ForkJoinTask.java:720) atcom.androID.IDe.common.internal.WaitableExecutor.waitForTasksWithQuickFail(WaitableExecutor.java:149) atcom.androID.build.gradle.internal.transforms.InstantRunSliceSplitApkBuilder.transform(InstantRunSliceSplitApkBuilder.java:246) atcom.androID.build.gradle.internal.pipeline.transformTask.call(transformTask.java:239) atcom.androID.build.gradle.internal.pipeline.transformTask.call(transformTask.java:235) atcom.androID.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102) atcom.androID.build.gradle.internal.pipeline.transformTask.transform(transformTask.java:230) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) atorg.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73) atorg.gradle.API.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:47) atorg.gradle.API.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:41) atorg.gradle.API.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28) atorg.gradle.API.internal.tasks.execution.ExecuteActionsTaskExecuter.run(ExecuteActionsTaskExecuter.java:284) atorg.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301) atorg.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293) atorg.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175) atorg.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91) atorg.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) atorg.gradle.API.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:273) atorg.gradle.API.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:258) atorg.gradle.API.internal.tasks.execution.ExecuteActionsTaskExecuter.access0(ExecuteActionsTaskExecuter.java:67) atorg.gradle.API.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:145) atorg.gradle.internal.execution.impl.steps.ExecuteStep.execute(ExecuteStep.java:49) atorg.gradle.internal.execution.impl.steps.CancelExecutionStep.execute(CancelExecutionStep.java:34) atorg.gradle.internal.execution.impl.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:69) atorg.gradle.internal.execution.impl.steps.TimeoutStep.execute(TimeoutStep.java:49) atorg.gradle.internal.execution.impl.steps.CatchExceptionStep.execute(CatchExceptionStep.java:33) atorg.gradle.internal.execution.impl.steps.CreateOutputsstep.execute(CreateOutputsstep.java:50) atorg.gradle.internal.execution.impl.steps.SnapshotOutputStep.execute(SnapshotOutputStep.java:43) atorg.gradle.internal.execution.impl.steps.SnapshotOutputStep.execute(SnapshotOutputStep.java:29) atorg.gradle.internal.execution.impl.steps.CacheStep.executeWithoutCache(CacheStep.java:134) atorg.gradle.internal.execution.impl.steps.CacheStep.lambda$execute(CacheStep.java:83) at java.util.Optional.orElseGet(Optional.java:267) atorg.gradle.internal.execution.impl.steps.CacheStep.execute(CacheStep.java:82) atorg.gradle.internal.execution.impl.steps.CacheStep.execute(CacheStep.java:36) atorg.gradle.internal.execution.impl.steps.PrepareCachingStep.execute(PrepareCachingStep.java:33) atorg.gradle.internal.execution.impl.steps.StoreSnapshotsstep.execute(StoreSnapshotsstep.java:38) atorg.gradle.internal.execution.impl.steps.StoreSnapshotsstep.execute(StoreSnapshotsstep.java:23) atorg.gradle.internal.execution.impl.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:96) atorg.gradle.internal.execution.impl.steps.SkipUpToDateStep.lambda$execute
>找到看起来像的那条线(SkipUpToDateStep.java:89) at java.util.Optional.map(Optional.java:215) atorg.gradle.internal.execution.impl.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:52) atorg.gradle.internal.execution.impl.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:36) atorg.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:34) atorg.gradle.API.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:91) atorg.gradle.API.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:91) atorg.gradle.API.internal.tasks.execution.ValIDatingTaskExecuter.execute(ValIDatingTaskExecuter.java:57) atorg.gradle.API.internal.tasks.execution.SkipEmptySourcefilesTaskExecuter.execute(SkipEmptySourcefilesTaskExecuter.java:119) atorg.gradle.API.internal.tasks.execution.ResolvePrevIoUsstateExecuter.execute(ResolvePrevIoUsstateExecuter.java:43) atorg.gradle.API.internal.tasks.execution.CleanupStaleoutputsExecuter.execute(CleanupStaleoutputsExecuter.java:93) atorg.gradle.API.internal.tasks.execution.FinalizePropertIEsTaskExecuter.execute(FinalizePropertIEsTaskExecuter.java:45) atorg.gradle.API.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:94) atorg.gradle.API.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:56) atorg.gradle.API.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:55) atorg.gradle.API.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36) atorg.gradle.API.internal.tasks.execution.EventFiringTaskExecuter.executeTask(EventFiringTaskExecuter.java:67) atorg.gradle.API.internal.tasks.execution.EventFiringTaskExecuter.call(EventFiringTaskExecuter.java:52) atorg.gradle.API.internal.tasks.execution.EventFiringTaskExecuter.call(EventFiringTaskExecuter.java:49) atorg.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:315) atorg.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:305) atorg.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175) atorg.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:101) atorg.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36) atorg.gradle.API.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:49) atorg.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43) atorg.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355) atorg.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343) atorg.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336) atorg.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322) atorg.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:134) atorg.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:129) atorg.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:202) atorg.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193) atorg.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:129) atorg.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) atorg.gradle.internal.concurrent.ManagedExecutorImpl.run(ManagedExecutorImpl.java:46) atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) atorg.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55) at java.lang.Thread.run(Thread.java:745) Caused by:java.lang.RuntimeException: java.io.fileNotFoundException:F:\AndroID\KNowtrend2\app\build\intermediates\instant_run_split_apk_resources\deBUG\instantRunSplitApkResourcesDeBUG\out\slice_3\resources_ap atjava.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1431) at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) atjava.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) atjava.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) atjava.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)Caused by: java.io.fileNotFoundException:F:\AndroID\KNowtrend2\app\build\intermediates\instant_run_split_apk_resources\deBUG\instantRunSplitApkResourcesDeBUG\out\slice_3\resources_ap atcom.androID.build.gradle.internal.transforms.InstantRunSliceSplitApkBuilder.lambda$null(InstantRunSliceSplitApkBuilder.java:233) atjava.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424) ... 4 more
解决方法:
这可以通过更新到Gradle 5.4来解决
最简单的方法是更新正在使用的包装器:
>打开gradle / gradle-wrapper.propertIEsdistributionUrl=https\://services.gradle.org/distributions/gradle-5.4-all.zip
>将版本更改为5.4
然后尝试再次运行构建.
另一种解决方法是禁用即时运行.转到文件 – >设置 – >即时运行,然后取消选中该框(或使用Mac用户的首选项).
总结以上是内存溢出为你收集整理的java – 应用程序中的Gradle崩溃:transformDexWithInstantRunSlicesApkForDebug全部内容,希望文章能够帮你解决java – 应用程序中的Gradle崩溃:transformDexWithInstantRunSlicesApkForDebug所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)