bytedance / ByteX

ByteX is a bytecode plugin platform based on Android Gradle Transform API and ASM. 字节码插件开发平台
Apache License 2.0
3.14k stars 463 forks source link

R8 和 method-call-opt-plugin compile 失败, access-inline-plugin const-inline-plugin refer-check-plugin base-plugin 都没有问题 #133

Open Xinmeng322 opened 2 years ago

Xinmeng322 commented 2 years ago

/home/root/code/buildM2u/app/build/intermediates/transforms/booster/normal/release/301.jar: R8: com.android.tools.r8.errors.a at com.android.tools.r8.ir.conversion.O.b(:57) at com.android.tools.r8.ir.conversion.O.a(:390) at com.android.tools.r8.ir.conversion.O.a(:336) at com.android.tools.r8.utils.S0.a(:10) at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424) at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) Suppressed: java.util.concurrent.ExecutionException: com.android.tools.r8.errors.a at java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1006) at com.android.tools.r8.utils.S0.a(:14) at com.android.tools.r8.utils.S0.a(:9) at com.android.tools.r8.ir.conversion.a0.a(:49) at com.android.tools.r8.ir.conversion.O.a(:160) at com.android.tools.r8.R8.a(:354) at com.android.tools.r8.R8.c(:1) at com.android.tools.r8.R8.b(:1) at com.android.tools.r8.utils.W.a(:30) at com.android.tools.r8.R8.a(:28) at com.android.tools.r8.R8.run(:3) at com.android.builder.dexing.R8Tool.runR8(r8Tool.kt:247) at com.android.build.gradle.internal.tasks.R8Task$Companion.shrink(R8Task.kt:472) at com.android.build.gradle.internal.tasks.R8Task.doTaskAction(R8Task.kt:334) at com.android.build.gradle.internal.tasks.NonIncrementalTask$taskAction$$inlined$recordTaskAction$1.invoke(AndroidVariantTask.kt:74) at com.android.build.gradle.internal.tasks.NonIncrementalTask$taskAction$$inlined$recordTaskAction$1.invoke(AndroidVariantTask.kt:34) at com.android.build.gradle.internal.tasks.Blocks.recordSpan(Blocks.java:91) at com.android.build.gradle.internal.tasks.NonIncrementalTask.taskAction(NonIncrementalTask.kt:57) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.run(ExecuteActionsTaskExecuter.java:555) at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29) at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26) at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75) at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68) at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56) at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:71) at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:71) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:540) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:523) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$300(ExecuteActionsTaskExecuter.java:108) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.executeWithPreviousOutputFiles(ExecuteActionsTaskExecuter.java:271) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:260) at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$1(ExecuteStep.java:34) at java.util.Optional.orElseGet(Optional.java:267) at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:34) at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26) at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:67) at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:36) at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:49) at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:34) at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:43) at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73) at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54) at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:44) at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:54) at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:38) at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:42) at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:159) at org.gradle.internal.execution.steps.CacheStep.executeAndStoreInCache(CacheStep.java:135) at org.gradle.internal.execution.steps.CacheStep.lambda$executeWithCache$2(CacheStep.java:112) at java.util.Optional.orElseGet(Optional.java:267) at org.gradle.internal.execution.steps.CacheStep.lambda$executeWithCache$3(CacheStep.java:112) at org.gradle.internal.Try$Success.map(Try.java:162) at org.gradle.internal.execution.steps.CacheStep.executeWithCache(CacheStep.java:81) at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:71) at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:43) at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:44) at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:33) at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38) at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24) at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:92) at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:85) at java.util.Optional.map(Optional.java:215) at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:55) at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:39) at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:76) at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:37) at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:36) at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:26) at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:94) at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:49) at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:79) at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:53) at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:74) at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:78) at java.util.Optional.orElseGet(Optional.java:267) at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:78) at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:34) at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:39) at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:40) at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:28) at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:187) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:179) at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109) at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46) at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56) at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195) at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75) at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68) at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62) at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76) at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54) at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52) at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:372) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:359) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:352) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:338) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124) 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) [CIRCULAR REFERENCE:com.android.tools.r8.errors.a] Caused by: java.lang.NullPointerException at com.android.tools.r8.ir.conversion.t$a.a(:1) at com.android.tools.r8.ir.conversion.t.a(:12) at com.android.tools.r8.r.n.E.a(:17) at com.android.tools.r8.ir.conversion.o.a(:153) at com.android.tools.r8.ir.conversion.N.a(:133) at com.android.tools.r8.graph.l.a(:93) at com.android.tools.r8.graph.l.a(:68) at com.android.tools.r8.graph.l.buildIR(:1) at com.android.tools.r8.graph.C0.buildIR(:1) at com.android.tools.r8.graph.T.a(:152) at com.android.tools.r8.ir.conversion.O.a(:412) at com.android.tools.r8.ir.conversion.O.b(:53) ... 8 more

yangzhiqian commented 2 years ago

/home/root/code/buildM2u/app/build/intermediates/transforms/booster/normal/release/301.jar 用工具校验一下这个jar,r8处理这个jar中的class出错了,这个问题暂时不能确定是那一方的问题,有可能是bytex插件的问题,也有可能是r8的bug,也有可能是其他插件处理出的结果有问题。

ouyangyj commented 1 year ago

启用R8后,同样遇到这个问题,在启用R8之前都正常,屏蔽method-call-opt-plugin后也正常

Caused by: java.util.concurrent.ExecutionException: com.android.tools.r8.internal.rO0: java.lang.NullPointerException 14:48:32 at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:531) 14:48:32 at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:492) 14:48:32 at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.java:83) 14:48:32 at com.android.tools.r8.utils.B.a(SourceFile:11) 14:48:32 at com.android.tools.r8.utils.B.a(SourceFile:40) 14:48:32 at com.android.tools.r8.utils.B.a(SourceFile:38) 14:48:32 at com.android.tools.r8.utils.B.a(SourceFile:37) 14:48:32 at com.android.tools.r8.ir.conversion.p.a(SourceFile:40) 14:48:32 at com.android.tools.r8.ir.conversion.p.a(SourceFile:2) 14:48:32 at com.android.tools.r8.ir.conversion.r.a(SourceFile:67) 14:48:32 at com.android.tools.r8.ir.conversion.r.a(SourceFile:11) 14:48:32 at com.android.tools.r8.D8.d(D8.java:39) 14:48:32 ... 13 more 14:48:32 Caused by: com.android.tools.r8.internal.rO0: java.lang.NullPointerException 14:48:32 at com.android.tools.r8.internal.rO0.a(SourceFile:6) 14:48:32 at com.android.tools.r8.internal.pO0.a(SourceFile:101) 14:48:32 at com.android.tools.r8.ir.conversion.r.b(SourceFile:257) 14:48:32 at com.android.tools.r8.ir.conversion.r.a(SourceFile:194) 14:48:32 at com.android.tools.r8.ir.conversion.q.a(SourceFile:18) 14:48:32 at com.android.tools.r8.ir.conversion.r.a(SourceFile:124) 14:48:32 at com.android.tools.r8.ir.conversion.p.b(SourceFile:1) 14:48:32 at com.android.tools.r8.ir.conversion.n.a(SourceFile:1) 14:48:32 at com.android.tools.r8.ir.conversion.p.a(SourceFile:68) 14:48:32 at com.android.tools.r8.utils.B.a(SourceFile:36) 14:48:32 at com.android.tools.r8.utils.B.a(SourceFile:41) 14:48:32 at com.android.tools.r8.utils.B.a(SourceFile:35) 14:48:32 at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) 14:48:32 at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57) 14:48:32 at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) 14:48:32 at com.google.common.util.concurrent.MoreExecutors$DirectExecutorService.execute(MoreExecutors.java:258) 14:48:32 at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140) 14:48:32 at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:66) 14:48:32 at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:36) 14:48:32 at com.android.tools.r8.utils.B.a(SourceFile:34) 14:48:32 at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) 14:48:32 at com.android.tools.r8.utils.B.a(SourceFile:6) 14:48:32 ... 21 more 14:48:32 [CIRCULAR REFERENCE:java.lang.NullPointerException]