Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R8 minify fails when using AGP 8.4.0 #914

Open
rexmtorres opened this issue May 16, 2024 · 3 comments
Open

R8 minify fails when using AGP 8.4.0 #914

rexmtorres opened this issue May 16, 2024 · 3 comments

Comments

@rexmtorres
Copy link

Do you want to request a feature or report a bug?
Report a bug

What is the current behavior?
R8 minify fails after upgrading to Android Gradle Plugin v8.4.0. The error points to com.yalantis.ucrop.util.RectUtils.getCenterFromRect(android.graphics.RectF):

Execution failed for task ':app:minifyReleaseWithR8'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.R8Task$R8Runnable
   > Compilation failed to complete, position: Lcom/yalantis/ucrop/util/RectUtils;getCenterFromRect(Landroid/graphics/RectF;)V, origin: C:\Users\<user>\.gradle\caches\transforms-4\205e67f2b4d5394ca870f57e9996c2e4\transformed\ucrop-2.2.9-runtime.jar:com/yalantis/ucrop/util/RectUtils.class

What is the expected behavior?
Build should be successful with minify enabled.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
In your app module's build script (build.gradle.kts), enable minify on the build type you want to build (ex: release build type):

android {
    buildTypes {
        release {
            isMinifyEnabled = true
            ...
        }
        ...
    }
    ...
}

Please attach any image files, URL and stack trace that can be used to reproduce the bug.
Stack trace:

> Task :app:minifyReleaseWithR8 FAILED
AGPBI: {"kind":"error","text":"java.lang.NullPointerException: Cannot invoke \"com.android.tools.r8.internal.Gk0.B()\" because the return value of \"com.android.tools.r8.internal.Jw.b()\" is null","sources":[{"file":"C:\\Users\\Rex\\.gradle\\caches\\transforms-4\\205e67f2b4d5394ca870f57e9996c2e4\\transformed\\ucrop-2.2.9-runtime.jar"}],"tool":"R8"}

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:minifyReleaseWithR8'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.R8Task$R8Runnable
   > Compilation failed to complete, position: Lcom/yalantis/ucrop/util/RectUtils;getCenterFromRect(Landroid/graphics/RectF;)V, origin: C:\Users\Rex\.gradle\caches\transforms-4\205e67f2b4d5394ca870f57e9996c2e4\transformed\ucrop-2.2.9-runtime.jar:com/yalantis/ucrop/util/RectUtils.class

* Try:
> 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.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:minifyReleaseWithR8'.
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:148)
	at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:282)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:146)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:134)
	at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
	at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:74)
	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:204)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
	at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:42)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:331)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:318)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.lambda$execute$0(DefaultTaskExecutionGraph.java:314)
	at org.gradle.internal.operations.CurrentBuildOperationRef.with(CurrentBuildOperationRef.java:80)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:314)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:303)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:463)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:380)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)
Caused by: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing com.android.build.gradle.internal.tasks.R8Task$R8Runnable
	at org.gradle.workers.internal.DefaultWorkerExecutor$WorkItemExecution.waitForCompletion(DefaultWorkerExecutor.java:283)
	at org.gradle.internal.work.DefaultAsyncWorkTracker.lambda$waitForItemsAndGatherFailures$2(DefaultAsyncWorkTracker.java:130)
	at org.gradle.internal.Factories$1.create(Factories.java:31)
	at org.gradle.internal.work.DefaultWorkerLeaseService.withoutLocks(DefaultWorkerLeaseService.java:336)
	at org.gradle.internal.work.DefaultWorkerLeaseService.withoutLocks(DefaultWorkerLeaseService.java:319)
	at org.gradle.internal.work.DefaultWorkerLeaseService.withoutLock(DefaultWorkerLeaseService.java:324)
	at org.gradle.internal.work.DefaultAsyncWorkTracker.waitForItemsAndGatherFailures(DefaultAsyncWorkTracker.java:126)
	at org.gradle.internal.work.DefaultAsyncWorkTracker.waitForItemsAndGatherFailures(DefaultAsyncWorkTracker.java:92)
	at org.gradle.internal.work.DefaultAsyncWorkTracker.waitForAll(DefaultAsyncWorkTracker.java:78)
	at org.gradle.internal.work.DefaultAsyncWorkTracker.waitForCompletion(DefaultAsyncWorkTracker.java:66)
	at org.gradle.api.internal.tasks.execution.TaskExecution$3.run(TaskExecution.java:255)
	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$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
	at org.gradle.api.internal.tasks.execution.TaskExecution.executeAction(TaskExecution.java:232)
	at org.gradle.api.internal.tasks.execution.TaskExecution.executeActions(TaskExecution.java:215)
	at org.gradle.api.internal.tasks.execution.TaskExecution.executeWithPreviousOutputFiles(TaskExecution.java:198)
	at org.gradle.api.internal.tasks.execution.TaskExecution.execute(TaskExecution.java:165)
	at org.gradle.internal.execution.steps.ExecuteStep.executeInternal(ExecuteStep.java:105)
	at org.gradle.internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:44)
	at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:59)
	at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:56)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
	at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:56)
	at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:44)
	at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:41)
	at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:74)
	at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:55)
	at org.gradle.internal.execution.steps.PreCreateOutputParentsStep.execute(PreCreateOutputParentsStep.java:50)
	at org.gradle.internal.execution.steps.PreCreateOutputParentsStep.execute(PreCreateOutputParentsStep.java:28)
	at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:67)
	at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:37)
	at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:61)
	at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:26)
	at org.gradle.internal.execution.steps.CaptureOutputsAfterExecutionStep.execute(CaptureOutputsAfterExecutionStep.java:64)
	at org.gradle.internal.execution.steps.CaptureOutputsAfterExecutionStep.execute(CaptureOutputsAfterExecutionStep.java:42)
	at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:40)
	at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:29)
	at org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:189)
	at org.gradle.internal.execution.steps.BuildCacheStep.executeAndStoreInCache(BuildCacheStep.java:145)
	at org.gradle.internal.execution.steps.BuildCacheStep.lambda$executeWithCache$4(BuildCacheStep.java:101)
	at org.gradle.internal.execution.steps.BuildCacheStep.lambda$executeWithCache$5(BuildCacheStep.java:101)
	at org.gradle.internal.Try$Success.map(Try.java:164)
	at org.gradle.internal.execution.steps.BuildCacheStep.executeWithCache(BuildCacheStep.java:85)
	at org.gradle.internal.execution.steps.BuildCacheStep.lambda$execute$0(BuildCacheStep.java:74)
	at org.gradle.internal.Either$Left.fold(Either.java:115)
	at org.gradle.internal.execution.caching.CachingState.fold(CachingState.java:59)
	at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:73)
	at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:48)
	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.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:76)
	at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$2(SkipUpToDateStep.java:54)
	at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:54)
	at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:36)
	at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:65)
	at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:36)
	at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37)
	at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27)
	at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:76)
	at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:37)
	at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:106)
	at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:55)
	at org.gradle.internal.execution.steps.AbstractCaptureStateBeforeExecutionStep.execute(AbstractCaptureStateBeforeExecutionStep.java:64)
	at org.gradle.internal.execution.steps.AbstractCaptureStateBeforeExecutionStep.execute(AbstractCaptureStateBeforeExecutionStep.java:43)
	at org.gradle.internal.execution.steps.AbstractSkipEmptyWorkStep.executeWithNonEmptySources(AbstractSkipEmptyWorkStep.java:125)
	at org.gradle.internal.execution.steps.AbstractSkipEmptyWorkStep.execute(AbstractSkipEmptyWorkStep.java:56)
	at org.gradle.internal.execution.steps.AbstractSkipEmptyWorkStep.execute(AbstractSkipEmptyWorkStep.java:36)
	at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
	at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:36)
	at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:23)
	at org.gradle.internal.execution.steps.HandleStaleOutputsStep.execute(HandleStaleOutputsStep.java:75)
	at org.gradle.internal.execution.steps.HandleStaleOutputsStep.execute(HandleStaleOutputsStep.java:41)
	at org.gradle.internal.execution.steps.AssignMutableWorkspaceStep.lambda$execute$0(AssignMutableWorkspaceStep.java:35)
	at org.gradle.api.internal.tasks.execution.TaskExecution$4.withWorkspace(TaskExecution.java:292)
	at org.gradle.internal.execution.steps.AssignMutableWorkspaceStep.execute(AssignMutableWorkspaceStep.java:31)
	at org.gradle.internal.execution.steps.AssignMutableWorkspaceStep.execute(AssignMutableWorkspaceStep.java:22)
	at org.gradle.internal.execution.steps.ChoosePipelineStep.execute(ChoosePipelineStep.java:40)
	at org.gradle.internal.execution.steps.ChoosePipelineStep.execute(ChoosePipelineStep.java:23)
	at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.lambda$execute$2(ExecuteWorkBuildOperationFiringStep.java:66)
	at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.execute(ExecuteWorkBuildOperationFiringStep.java:66)
	at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.execute(ExecuteWorkBuildOperationFiringStep.java:38)
	at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:36)
	at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:26)
	at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:47)
	at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:34)
	at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:61)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:145)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:134)
	at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
	at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:74)
	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:204)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
	at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:42)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:331)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:318)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.lambda$execute$0(DefaultTaskExecutionGraph.java:314)
	at org.gradle.internal.operations.CurrentBuildOperationRef.with(CurrentBuildOperationRef.java:80)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:314)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:303)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:463)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:380)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, position: Lcom/yalantis/ucrop/util/RectUtils;getCenterFromRect(Landroid/graphics/RectF;)V, origin: C:\Users\Rex\.gradle\caches\transforms-4\205e67f2b4d5394ca870f57e9996c2e4\transformed\ucrop-2.2.9-runtime.jar:com/yalantis/ucrop/util/RectUtils.class
	at Version.fakeStackEntry(Version_8.4.22.java:0)
	at com.android.tools.r8.Q.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:5)
	at com.android.tools.r8.internal.qo.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:82)
	at com.android.tools.r8.internal.qo.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:32)
	at com.android.tools.r8.internal.qo.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:31)
	at com.android.tools.r8.R8.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:79)
	at com.android.tools.r8.R8.run(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:3)
	at com.android.builder.dexing.R8Tool.runR8(r8Tool.kt:332)
	at com.android.build.gradle.internal.tasks.R8Task$Companion.shrink(R8Task.kt:782)
	at com.android.build.gradle.internal.tasks.R8Task$R8Runnable.execute(R8Task.kt:856)
	at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63)
	at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:66)
	at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:62)
	at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:100)
	at org.gradle.workers.internal.NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:62)
	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.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
	at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)
	at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:59)
	at org.gradle.workers.internal.DefaultWorkerExecutor.lambda$submitWork$0(DefaultWorkerExecutor.java:170)
	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:187)
	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.access$700(DefaultConditionalExecutionQueue.java:120)
	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner$1.run(DefaultConditionalExecutionQueue.java:162)
	at org.gradle.internal.Factories$1.create(Factories.java:31)
	at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:264)
	at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:128)
	at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:133)
	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:157)
	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:126)
	... 2 more
Caused by: java.lang.NullPointerException: Cannot invoke "com.android.tools.r8.internal.Gk0.B()" because the return value of "com.android.tools.r8.internal.Jw.b()" is null
	at com.android.tools.r8.internal.Kn.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:2)
	at com.android.tools.r8.internal.Vn.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:309)
	at com.android.tools.r8.internal.EJ.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:3786)
	at com.android.tools.r8.internal.Gt.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:439)
	at com.android.tools.r8.internal.Gt.d(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:34)
	at com.android.tools.r8.internal.Gt.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:419)
	at com.android.tools.r8.internal.qo.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:135)
	at com.android.tools.r8.internal.Gt.c(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:5)
	at com.android.tools.r8.internal.Gt.b(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:16)
	at com.android.tools.r8.internal.FX.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:221)
	at com.android.tools.r8.internal.XW.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:40)
	at com.android.tools.r8.internal.qg0.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:2)
	at com.android.tools.r8.internal.qg0.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:17)
	Suppressed: java.lang.RuntimeException: java.util.concurrent.ExecutionException: com.android.tools.r8.internal.so: java.lang.NullPointerException: Cannot invoke "com.android.tools.r8.internal.Gk0.B()" because the return value of "com.android.tools.r8.internal.Jw.b()" is null
		at com.android.tools.r8.internal.qo.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:132)
		at com.android.tools.r8.R8.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:1304)
		at com.android.tools.r8.R8.b(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:1)
		at com.android.tools.r8.internal.qo.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:28)
		at com.android.tools.r8.R8.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:79)
		at com.android.tools.r8.R8.run(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:3)
		at com.android.builder.dexing.R8Tool.runR8(r8Tool.kt:332)
		at com.android.build.gradle.internal.tasks.R8Task$Companion.shrink(R8Task.kt:782)
		at com.android.build.gradle.internal.tasks.R8Task$R8Runnable.execute(R8Task.kt:856)
		at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63)
		at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:66)
		at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:62)
		at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:100)
		at org.gradle.workers.internal.NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:62)
		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.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
		at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
		at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
		at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
		at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
		at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
		at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
		at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
		at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)
		at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:59)
		at org.gradle.workers.internal.DefaultWorkerExecutor.lambda$submitWork$0(DefaultWorkerExecutor.java:170)
		at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
		at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:187)
		at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.access$700(DefaultConditionalExecutionQueue.java:120)
		at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner$1.run(DefaultConditionalExecutionQueue.java:162)
		at org.gradle.internal.Factories$1.create(Factories.java:31)
		at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:264)
		at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:128)
		at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:133)
		at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:157)
		at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:126)
		at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
		at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
		at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
		at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)
		at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
		at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
		at java.base/java.lang.Thread.run(Thread.java:840)
	Caused by: java.util.concurrent.ExecutionException: com.android.tools.r8.internal.so: java.lang.NullPointerException: Cannot invoke "com.android.tools.r8.internal.Gk0.B()" because the return value of "com.android.tools.r8.internal.Jw.b()" is null
		at java.base/java.util.concurrent.ForkJoinTask.reportExecutionException(ForkJoinTask.java:605)
		at java.base/java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:981)
		at com.android.tools.r8.internal.rg0.awaitFutures(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:4)
		at com.android.tools.r8.internal.dg0.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:2)
		at com.android.tools.r8.internal.dg0.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:13)
		at com.android.tools.r8.internal.dg0.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:14)
		at com.android.tools.r8.internal.qg0.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:15)
		at com.android.tools.r8.internal.qg0.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:5)
		at com.android.tools.r8.internal.qg0.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:1)
		at com.android.tools.r8.internal.XW.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:16)
		at com.android.tools.r8.internal.FX.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:166)
		at com.android.tools.r8.internal.FX.b(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:4)
		at com.android.tools.r8.R8.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:377)
		... 42 more
	Caused by: com.android.tools.r8.internal.so: java.lang.NullPointerException: Cannot invoke "com.android.tools.r8.internal.Gk0.B()" because the return value of "com.android.tools.r8.internal.Jw.b()" is null
		at com.android.tools.r8.internal.qo.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:155)
		at com.android.tools.r8.internal.Gt.c(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:5)
		at com.android.tools.r8.internal.Gt.b(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:16)
		at com.android.tools.r8.internal.FX.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:221)
		at com.android.tools.r8.internal.XW.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:40)
		at com.android.tools.r8.internal.qg0.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:2)
		at com.android.tools.r8.internal.qg0.a(R8_8.4.22_2b932325cd6d46598bfa7e41c62a9eb3b5edfa12a8eb8a250504b6603707a619:17)
		at java.base/java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1428)
		at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
		at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
		at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
		at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
		at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
	Caused by: [CIRCULAR REFERENCE: java.lang.NullPointerException: Cannot invoke "com.android.tools.r8.internal.Gk0.B()" because the return value of "com.android.tools.r8.internal.Jw.b()" is null]

Which versions of uCrop, and which Android API versions are affected by this issue? Did this work in previous versions of uCrop?
I am using uCrop v2.2.9. The error is encountered when building with AGP v8.4.0. Older versions of AGP do not have this issue.

@amirsarafian
Copy link

Add three lines to proguard-rules.pro fix problem

-dontwarn com.yalantis.ucrop**
-keep class com.yalantis.ucrop** { ; }
-keep interface com.yalantis.ucrop
* { *; }

@sanjay-qlocar
Copy link

@amirsarafian I have already added this proguard-rules but not working same error showing

-dontwarn com.yalantis.ucrop**
-keep class com.yalantis.ucrop** { ; }
-keep interface com.yalantis.ucrop* { *; }

@beigirad
Copy link
Contributor

beigirad commented Jun 5, 2024

My job has done with:

-keep class com.yalantis.ucrop.util.RectUtils { *; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants