gpt4 book ai didi

android - 在Android Studio虚拟设备中调试时出错

转载 作者:行者123 更新时间:2023-12-03 17:47:43 25 4
gpt4 key购买 nike

在Android Emulator中使用debug时,出现错误:


java.lang.RuntimeException:java.lang.RuntimeException:
java.io.FileNotFoundException:
D:\ Android \ androiddtudio_project \ vitrin-android \ app \ build \ intermediates \ instant_run_split_apk_resources \ debug \ instantRunSplitApkResourcesDebug \ out \ slice_6 \ resources_ap
在sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
方法)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
在java.lang.reflect.Constructor.newInstance(Constructor.java:423)

java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:593)

java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:677)
在java.util.concurrent.ForkJoinTask.join(ForkJoinTask.java:720)在
com.android.ide.common.internal.WaitableExecutor.waitForTasksWithQuickFail(WaitableExecutor.java:149)

com.android.build.gradle.internal.transforms.InstantRunSliceSplitApkBuilder.transform(InstantRunSliceSplitApkBuilder.java:246)

com.android.build.gradle.internal.pipeline.TransformTask $ 2.call(TransformTask.java:239)

com.android.build.gradle.internal.pipeline.TransformTask $ 2.call(TransformTask.java:235)

com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)

com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:230)
在sun.reflect.GeneratedMethodAccessor85.invoke(未知源)在
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
在java.lang.reflect.Method.invoke(Method.java:498)在
org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)在
org.gradle.api.internal.project.taskfactory.IncrementalTask​​Action.doExecute(IncrementalTask​​Action.java:47)

org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:41)

org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)

org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter $ 2.run(ExecuteActionsTaskExecuter.java:284)

org.gradle.internal.operations.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)

org.gradle.internal.operations.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)

org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)

org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)

org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)

org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:273)

org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:258)

org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access $ 200(ExecuteActionsTaskExecuter.java:67)

org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter $ TaskExecution.execute(ExecuteActionsTaskExecuter.java:145)

org.gradle.internal.execution.impl.steps.ExecuteStep.execute(ExecuteStep.java:49)

org.gradle.internal.execution.impl.steps.CancelExecutionStep.execute(CancelExecutionStep.java:34)

org.gradle.internal.execution.impl.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:69)

org.gradle.internal.execution.impl.steps.TimeoutStep.execute(TimeoutStep.java:49)

org.gradle.internal.execution.impl.steps.CatchExceptionStep.execute(CatchExceptionStep.java:33)

org.gradle.internal.execution.impl.steps.CreateOutputsStep.execute(CreateOutputsStep.java:50)

org.gradle.internal.execution.impl.steps.SnapshotOutputStep.execute(SnapshotOutputStep.java:43)

org.gradle.internal.execution.impl.steps.SnapshotOutputStep.execute(SnapshotOutputStep.java:29)

org.gradle.internal.execution.impl.steps.CacheStep.executeWithoutCache(CacheStep.java:134)

org.gradle.internal.execution.impl.steps.CacheStep.lambda $ execute $ 3(CacheStep.java:83)
在java.util.Optional.orElseGet(Optional.java:267)在
org.gradle.internal.execution.impl.steps.CacheStep.execute(CacheStep.java:82)

org.gradle.internal.execution.impl.steps.CacheStep.execute(CacheStep.java:36)

org.gradle.internal.execution.impl.steps.PrepareCachingStep.execute(PrepareCachingStep.java:33)

org.gradle.internal.execution.impl.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:38)

org.gradle.internal.execution.impl.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:23)

org.gradle.internal.execution.impl.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:96)

org.gradle.internal.execution.impl.steps.SkipUpToDateStep.lambda $ execute $ 0(SkipUpToDateStep.java:89)
在java.util.Optional.map(Optional.java:215)在
org.gradle.internal.execution.impl.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:52)

org.gradle.internal.execution.impl.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:36)

org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:34)

org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:91)

org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:91)

org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57)

org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:119)

org.gradle.api.internal.tasks.execution.ResolvePreviousStateExecuter.execute(ResolvePreviousStateExecuter.java:43)

org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:93)

org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:45)

org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:94)

org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:56)

org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:55)

org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)

org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter $ 1.executeTask(EventFiringTaskExecuter.java:67)

org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter $ 1.call(EventFiringTaskExecuter.java:52)

org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter $ 1.call(EventFiringTaskExecuter.java:49)

org.gradle.internal.operations.DefaultBuildOperationExecutor $ CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:315)

org.gradle.internal.operations.DefaultBuildOperationExecutor $ CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:305)

org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)

org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:101)

org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)

org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:49)

org.gradle.execution.plan.LocalTask​​NodeExecutor.execute(LocalTask​​NodeExecutor.java:43)

org.gradle.execution.taskgraph.DefaultTaskExecutionGraph $ InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355)

org.gradle.execution.taskgraph.DefaultTaskExecutionGraph $ InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)

org.gradle.execution.taskgraph.DefaultTaskExecutionGraph $ BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)

org.gradle.execution.taskgraph.DefaultTaskExecutionGraph $ BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)

org.gradle.execution.plan.DefaultPlanExecutor $ ExecutorWorker $ 1.execute(DefaultPlanExecutor.java:134)

org.gradle.execution.plan.DefaultPlanExecutor $ ExecutorWorker $ 1.execute(DefaultPlanExecutor.java:129)

org.gradle.execution.plan.DefaultPlanExecutor $ ExecutorWorker.execute(DefaultPlanExecutor.java:202)

org.gradle.execution.plan.DefaultPlanExecutor $ ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193)

org.gradle.execution.plan.DefaultPlanExecutor $ ExecutorWorker.run(DefaultPlanExecutor.java:129)

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:1142)

java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)

org.gradle.internal.concurrent.ThreadFactoryImpl $ ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
在java.lang.Thread.run(Thread.java:745)造成原因:
java.lang.RuntimeException:java.io.FileNotFoundException:
D:\ Android \ androiddtudio_project \ vitrin-android \ app \ build \ intermediates \ instant_run_split_apk_resources \ debug \ instantRunSplitApkResourcesDebug \ out \ slice_6 \ resources_ap

java.util.concurrent.ForkJoinTask $ AdaptedCallable.exec(ForkJoinTask.java:1431)
在java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)

java.util.concurrent.ForkJoinPool $ WorkQueue.runTask(ForkJoinPool.java:1056)

java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)

java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
引起原因:java.io.FileNotFoundException:
D:\ Android \ androiddtudio_project \ vitrin-android \ app \ build \ intermediates \ instant_run_split_apk_resources \ debug \ instantRunSplitApkResourcesDebug \ out \ slice_6 \ resources_ap

com.android.build.gradle.internal.transforms.InstantRunSliceSplitApkBuilder.lambda $ null $ 1(InstantRunSliceSplitApkBuilder.java:233)

java.util.concurrent.ForkJoinTask $ AdaptedCallable.exec(ForkJoinTask.java:1424)
...另外4个


但是当使用电话时,没有问题。
我使用干净的项目并重建项目,但是没有用

error code

最佳答案

我曾经遇到此错误,可能是由变体问题引起的。其中之一是Instant Run

触发此错误时,我将尝试将其关闭:


Double click Shift要快速搜索,请键入instant run
选择Instant Run (preference),它将为您打开首选项设置
可能会勾选Enable Instant Run to hot swap...,请取消勾选并尝试。


可能有效或可能无效,请让我知道它是否有效。

关于android - 在Android Studio虚拟设备中调试时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56358090/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com