3

最近开始使用 IntelliJ IDE。我正在尝试在 IntelliJ 中打开一个 Android 项目,该项目是在 Android studio IDE 中构建的。但这导致了许多问题。其中一个没有解决的是transformClassesWithDexBuilderForDebug

我已经尝试了所有可能的 dex 问题解决方案,但似乎没有任何效果。

在查看 --stacktrace 时发现了这个

错误处理 C:\Users\prath.gradle\caches\modules-2\files-2.1\org.projectlombok**lombok**\1.18.2\524e0a697e9d62950b2f763d88d35cd8dc82a9a1\lombok-1.18.2.jar java.lang。运行时异常 在 org.objectweb.asm.ClassVisitor.visitModule(ClassVisitor.java:148) 在 org.objectweb.asm.ClassReader.readModule(ClassReader.java:731) 在 org.objectweb.asm.ClassReader.accept(ClassReader.java:632 ) 在 org.objectweb.asm.ClassReader.accept(ClassReader.java:500) 在 com.android.builder.desugaring.DesugaringClassAnalyzer.analyze(DesugaringClassAnalyzer.java:144) 在 com.android.builder.desugaring.DesugaringClassAnalyzer.analyzeJar( DesugaringClassAnalyzer.java:92) 在 com.android.builder.desugaring.DesugaringClassAnalyzer.analyze(DesugaringClassAnalyzer.java:63) 在 com.android.build.gradle.internal.transforms.DesugarIncrementalTransformHelper.lambda$getInitalGraphData$4(DesugarIncrementalTransformHelper.java:150 ) 在 java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:第1448章、 .java:1656) 在 java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) 在 java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)

任务:应用程序:transformClassesWithDexBuilderForDebug失败的 java.lang.RuntimeException:java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0 处的 java.lang.RuntimeException(Native 方法)在 java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62 ) 在 java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 在 java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) 在 java.base/java。 util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:600) 在 java.base/java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:678) 在 java.base/java.util.concurrent.ForkJoinTask.join( ForkJoinTask.java:722) 在 com.android.ide.common.internal.WaitableExecutor。com.android.build.gradle.internal.transforms.DesugarIncrementalTransformHelper.makeDesugaringGraph(DesugarIncrementalTransformHelper. java:130) 在 com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:160) 在 com.android.build.gradle.internal.transforms.DesugarIncrementalTransformHelper.getDependenciesPaths(DesugarIncrementalTransformHelper.java:231) 在 com .android.build.gradle.internal.transforms.DexArchiveBuilderTransform.getD8DesugaringCacheInfo(DexArchiveBuilderTransform.java:461) 在 com.android.build.gradle.internal.transforms.DexArchiveBuilderTransform。transform(DexArchiveBuilderTransform.java:375) 在 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) 在 java .base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 在 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 在 java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl。在 org.gradle.internal.reflect.JavaMethod 的 java.base/java.lang.reflect.Method.invoke(Method.java:566) 处调用(DelegatingMethodAccessorImpl.java:43)。在 org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction. java:39) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:131 ) 在 org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292) 在 org.gradle.internal 的 org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300)。操作.DefaultBuildOperationExecutor。在 org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) 的 org.gradle.internal.operations.run(DelegatingBuildOperationExecutor.java:31) 处执行(DefaultBuildOperationExecutor.java:174) .api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120) 在 org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:99) 在 org.gradle.api.internal .tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77) 在 org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51) 在 org.gradle.api.internal.tasks.execution .SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59) at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute( ValidatingTaskExecuter.java:59) 在 org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101) 在 org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java: 44) 在 org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62) 在 org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54) 在 org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59) .gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) 在 org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34) 在 org.gradle.api .internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:51) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300) at org.gradle.internal.operations.DefaultBuildOperationExecutor$ RunnableBuildOperationWorker。在 org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) 在 org.gradle 的 org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174) 执行(DefaultBuildOperationExecutor.java:292) .internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) 在 org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46) 在 org.gradle.execution.taskgraph.LocalTask​​InfoExecutor.execute (LocalTask​​InfoExecutor.java:42) 在 org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:277) 在 org.gradle.execution.taskgraph。DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:262) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:135) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute( DefaultTaskPlanExecutor.java:130) 在 org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.execute(DefaultTaskPlanExecutor.java:200) 在 org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.executeWithWork(DefaultTaskPlanExecutor.java:191) 在 org .gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.run(DefaultTaskPlanExecutor.java:130) 在 org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:74) 在 org.gradle.execution。taskgraph.DefaultTaskExecutionGraph.execute(DefaultTaskExecutionGraph.java:143) at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:40) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:40) at org.gradle .execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:24) at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:46) at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:49) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:40) 在 org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:33) 在 org.gradle.initialization.DefaultGradleLauncher$ExecuteTasks.run(DefaultGradleLauncher.java: 355) 在 org.gradle。internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute( DefaultBuildOperationExecutor.java:174) 在 org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) 在 org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) 在 org.gradle.initialization .DefaultGradleLauncher.runTasks(DefaultGradleLauncher.java:219) 在 org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:149) 在 org.gradle.initialization。DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:124) at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:77) at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:74)在 org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:154) 在 org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:38) 在 org.gradle.internal.invocation.GradleBuildController.doBuild (GradleBuildController.java:96) 在 org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:74) 在 org.gradle.tooling.internal.provider.runner.ClientProvidedBuildActionRunner.run(ClientProvidedBuildActionRunner.java:68) 在org.gradle.launcher.exec。ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)在 org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.run(RunAsBuildOperationBuildActionRunner.java:50) 在 org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300) 在 org.gradle.internal.operations。 DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292) 在 org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174) 在 org.gradle.internal.operations。DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:45) at org .gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51) at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:47) at org.gradle.launcher.exec.InProcessBuildActionExecuter$1 .transform(InProcessBuildActionExecuter.java:44) 在 org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:79) 在 org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:44) 在 org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39) 在 org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter 的 org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30) .execute(BuildTreeScopeBuildActionExecuter.java:25) 在 org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80) 在 org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53) ) 在 org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:34) 在 org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25) 在 org.gradle.tooling 的 org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36) .internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43) 在 org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29) 在 org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute (StartParamsValidatingActionExecuter.java:59) 在 org.gradle.tooling 的 org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:31)。internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59) at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44) at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute( SetupLoggingActionExecuter.java:46) 在 org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30) 在 org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)在 org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) 在 org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) 在 org.gradle .launcher.daemon.server.exec.WatchForDisconnection。在 org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger. java:26) 在 org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34) 的 org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)在 org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) 在 org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74) 在 org. gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72) at org.gradle.util.Swapper.swap(Swapper.java:38) 在 org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72) 在 org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)在 org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55) 在 org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) 在 org.gradle .launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62) 在 org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) 在 org.gradle.launcher.daemon .server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) 在 org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:81) 在 org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) 在 org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) 在 org .gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50) at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295) at org.gradle.internal .concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker( ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at org.java.base/java.lang.Thread.run(Thread.java:834) 处的 gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55) 原因:org.objectweb 处的 java.lang.RuntimeException。 asm.ClassVisitor.visitModule(ClassVisitor.java:148) 在 org.objectweb.asm.ClassReader.readModule(ClassReader.java:731) 在 org.objectweb.asm.ClassReader.accept(ClassReader.java:632) 在 org.objectweb .asm.ClassReader.accept(ClassReader.java:500) 在 com.android.builder.desugaring.DesugaringClassAnalyzer.analyze(DesugaringClassAnalyzer.java:144) 在 com.android.builder.desugaring.DesugaringClassAnalyzer.analyzeJar(DesugaringClassAnalyzer.java:92 ) 在 com.android.build.gradle.internal.transforms 的 com.android.builder.desugaring.DesugaringClassAnalyzer.analyze(DesugaringClassAnalyzer.java:63)。DesugarIncrementalTransformHelper.lambda$getInitalGraphData$4(DesugarIncrementalTransformHelper.java:150) at java.base/java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1448) at java.base/java.util.concurrent.ForkJoinTask.doExec (ForkJoinTask.java:290) 在 java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) 在 java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) ) 在 java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) 在 java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) 在 java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) 在 java.base/java.util。 concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) 在 java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) 在 java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.爪哇:177)base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) 在 java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) 在 java.base/java.util。 concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) 在 java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) 在 java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.爪哇:177)爪哇:177)爪哇:177)

它说:*出了什么问题:
任务':app:transformClassesWithDexBuilderForDebug'的执行失败。
com.android.build.api.transform.TransformException:java.lang.RuntimeException:java.lang.RuntimeException

我该如何解决这个问题?

我在设置中启用了“注释”,Lombok 已更新,清理和重建已完成 N 次,无效并重新启动。

4

1 回答 1

9

试试这个 gradle.properties:

  android.enableD8.desugaring = true
  android.enableIncrementalDesugaring = false

该解决方案运行良好。这是完美的解决方案。

于 2018-10-08T13:42:27.980 回答