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

TaskCreationException because of DefaultSelfResolvingDependency with Gradle 8.7+ #12

Open
G00fY2 opened this issue Jun 11, 2024 · 18 comments

Comments

@G00fY2
Copy link

G00fY2 commented Jun 11, 2024

The plugin is currently not compatible with Gradle 8.7+ because it uses internal Gradle APIs that are not available anymore:

val isDefaultSelfResolvingDependency = dependency is DefaultSelfResolvingDependency

DefaultSelfResolvingDependency was replaced with DefaultFileCollectionDependency in Gradle 8.7 with this commit: gradle/gradle@a5bd459

Therefore the appsweep plugin fails at configuration with the following stacktrace:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':tasks'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:130)
        at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:282)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:128)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:116)
        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:209)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
        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:166)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
        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.api.internal.tasks.DefaultTaskContainer$TaskCreationException: Could not create task ':app:uploadToAppSweepGoogleDevDebug'.
        at org.gradle.api.internal.tasks.DefaultTaskContainer.taskCreationException(DefaultTaskContainer.java:717)
        at org.gradle.api.internal.tasks.DefaultTaskContainer.access$600(DefaultTaskContainer.java:78)
        at org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreatingProvider.domainObjectCreationException(DefaultTaskContainer.java:709)
        at org.gradle.api.internal.DefaultNamedDomainObjectCollection$AbstractDomainObjectCreatingProvider.tryCreate(DefaultNamedDomainObjectCollection.java:1017)
        at org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreatingProvider.access$1401(DefaultTaskContainer.java:656)
        at org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreatingProvider$1.run(DefaultTaskContainer.java:682)
        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:166)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
        at org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreatingProvider.tryCreate(DefaultTaskContainer.java:678)
        at org.gradle.api.internal.DefaultNamedDomainObjectCollection$AbstractDomainObjectCreatingProvider.calculateOwnValue(DefaultNamedDomainObjectCollection.java:991)
        at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateValue(AbstractMinimalProvider.java:115)
        at org.gradle.api.internal.provider.Collectors$ElementFromProvider.collectEntries(Collectors.java:120)
        at org.gradle.api.internal.provider.Collectors$TypedCollector.collectEntries(Collectors.java:415)
        at org.gradle.api.internal.provider.Collectors$TypedCollector.collectInto(Collectors.java:410)
        at org.gradle.api.internal.collections.SortedSetElementSource.realize(SortedSetElementSource.java:141)
        at org.gradle.api.internal.collections.SortedSetElementSource.realizePending(SortedSetElementSource.java:119)
        at org.gradle.api.internal.collections.SortedSetElementSource.iterator(SortedSetElementSource.java:78)
        at org.gradle.api.internal.DefaultDomainObjectCollection.iterator(DefaultDomainObjectCollection.java:128)
        at org.gradle.api.internal.tasks.DefaultTaskContainer.iterator(DefaultTaskContainer.java:622)
        at org.gradle.api.tasks.diagnostics.internal.SingleProjectTaskReportModel.forTasks(SingleProjectTaskReportModel.java:31)
        at org.gradle.api.tasks.diagnostics.TaskReportTask.lambda$buildTaskReportModelFor$4(TaskReportTask.java:262)
        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$fromMutableState$2(DefaultProjectStateRegistry.java:430)
        at org.gradle.internal.work.DefaultWorkerLeaseService.withReplacedLocks(DefaultWorkerLeaseService.java:360)
        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(DefaultProjectStateRegistry.java:430)
        at org.gradle.api.tasks.diagnostics.TaskReportTask.buildTaskReportModelFor(TaskReportTask.java:261)
        at org.gradle.api.tasks.diagnostics.TaskReportTask.taskReportModelFor(TaskReportTask.java:249)
        at org.gradle.api.tasks.diagnostics.TaskReportTask.projectReportModelFor(TaskReportTask.java:213)
        at org.gradle.api.tasks.diagnostics.TaskReportTask.lambda$computeProjectModels$2(TaskReportTask.java:177)
        at org.gradle.internal.Try.ofFailable(Try.java:41)
        at org.gradle.api.tasks.diagnostics.TaskReportTask.computeProjectModels(TaskReportTask.java:177)
        at org.gradle.api.tasks.diagnostics.TaskReportTask.computeTaskReportModel(TaskReportTask.java:171)
        at org.gradle.internal.Try.ofFailable(Try.java:41)
        at org.gradle.internal.serialization.Cached$Deferred.result(Cached.java:53)
        at org.gradle.internal.serialization.Cached$Deferred.get(Cached.java:48)
        at org.gradle.api.tasks.diagnostics.TaskReportTask.generate(TaskReportTask.java:161)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:125)
        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.TaskExecution$3.run(TaskExecution.java:244)
        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:166)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
        at org.gradle.api.internal.tasks.execution.TaskExecution.executeAction(TaskExecution.java:229)
        at org.gradle.api.internal.tasks.execution.TaskExecution.executeActions(TaskExecution.java:212)
        at org.gradle.api.internal.tasks.execution.TaskExecution.executeWithPreviousOutputFiles(TaskExecution.java:195)
        at org.gradle.api.internal.tasks.execution.TaskExecution.execute(TaskExecution.java:162)
        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:209)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
        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:166)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
        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:67)
        at org.gradle.internal.execution.steps.CaptureOutputsAfterExecutionStep.execute(CaptureOutputsAfterExecutionStep.java:45)
        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.lambda$execute$1(BuildCacheStep.java:75)
        at org.gradle.internal.Either$Right.fold(Either.java:175)
        at org.gradle.internal.execution.caching.CachingState.fold(CachingState.java:62)
        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:46)
        at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:35)
        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.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27)
        at org.gradle.internal.execution.steps.ResolveIncrementalCachingStateStep.executeDelegate(ResolveIncrementalCachingStateStep.java:49)
        at org.gradle.internal.execution.steps.ResolveIncrementalCachingStateStep.executeDelegate(ResolveIncrementalCachingStateStep.java:27)
        at org.gradle.internal.execution.steps.AbstractResolveCachingStateStep.execute(AbstractResolveCachingStateStep.java:71)
        at org.gradle.internal.execution.steps.AbstractResolveCachingStateStep.execute(AbstractResolveCachingStateStep.java:39)
        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.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:289)
        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:67)
        at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.execute(ExecuteWorkBuildOperationFiringStep.java:67)
        at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.execute(ExecuteWorkBuildOperationFiringStep.java:39)
        at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:46)
        at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:34)
        at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:48)
        at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:35)
        at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:61)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:127)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:116)
        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:209)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
        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:166)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
        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: java.lang.NoClassDefFoundError: org/gradle/api/internal/artifacts/dependencies/DefaultSelfResolvingDependency
        at com.guardsquare.appsweep.gradle.AppSweepPlugin.createAppDependency(AppSweepPlugin.kt:435)
        at com.guardsquare.appsweep.gradle.AppSweepPlugin.createAppDependencySet(AppSweepPlugin.kt:416)
        at com.guardsquare.appsweep.gradle.AppSweepPlugin.getAllDependencies(AppSweepPlugin.kt:388)
        at com.guardsquare.appsweep.gradle.AppSweepPlugin.access$getAllDependencies(AppSweepPlugin.kt:26)
        at com.guardsquare.appsweep.gradle.AppSweepPlugin$registerTasksForVariant$1$task$1.invoke(AppSweepPlugin.kt:269)
        at com.guardsquare.appsweep.gradle.AppSweepPlugin$registerTasksForVariant$1$task$1.invoke(AppSweepPlugin.kt:253)
        at com.guardsquare.appsweep.gradle.AppSweepPlugin.registerTasksForVariant$lambda$6$lambda$5(AppSweepPlugin.kt:256)
        at org.gradle.api.internal.DefaultMutationGuard$1.execute(DefaultMutationGuard.java:45)
        at org.gradle.api.internal.DefaultMutationGuard$1.execute(DefaultMutationGuard.java:45)
        at org.gradle.internal.code.DefaultUserCodeApplicationContext$CurrentApplication$1.execute(DefaultUserCodeApplicationContext.java:123)
        at org.gradle.api.internal.DefaultCollectionCallbackActionDecorator$BuildOperationEmittingAction$1.run(DefaultCollectionCallbackActionDecorator.java:110)
        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:166)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
        at org.gradle.api.internal.DefaultCollectionCallbackActionDecorator$BuildOperationEmittingAction.execute(DefaultCollectionCallbackActionDecorator.java:107)
        at org.gradle.internal.ImmutableActionSet$SetWithManyActions.execute(ImmutableActionSet.java:329)
        at org.gradle.api.internal.DefaultDomainObjectCollection.doAdd(DefaultDomainObjectCollection.java:262)
        at org.gradle.api.internal.DefaultNamedDomainObjectCollection.doAdd(DefaultNamedDomainObjectCollection.java:125)
        at org.gradle.api.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.java:256)
        at org.gradle.api.internal.DefaultNamedDomainObjectCollection$AbstractDomainObjectCreatingProvider.tryCreate(DefaultNamedDomainObjectCollection.java:1011)
        ... 154 more
Caused by: java.lang.ClassNotFoundException: org.gradle.api.internal.artifacts.dependencies.DefaultSelfResolvingDependency
        ... 178 more
@titze
Copy link
Contributor

titze commented Jun 12, 2024

Hi @G00fY2,
thanks for the bug report!

Indeed, at the moment, the plugin does not support newer Gradle versions, we are working on fixing this. I will keep this issue open and can ping you one a new version is released.

@ArcherEmiya05
Copy link

Any update on this? It is now our only blocker in the pipeline.

@titze
Copy link
Contributor

titze commented Jun 19, 2024

@ArcherEmiya05 unfortunately not. As this is a bigger refactor, it might take a bit until it is finished.

@ArcherEmiya05
Copy link

@ArcherEmiya05 unfortunately not. As this is a bigger refactor, it might take a bit until it is finished.

Will it take months to finish cause we are now considering removing the plugin for now?

@titze
Copy link
Contributor

titze commented Jun 24, 2024

Unfortunately I do not know an exact ETA yet, but it will definitely take a bit.

Currently the options are downgrading Gradle (might not work in your project), or using the CLI for CI integration (Help Article HowTo).
Is using the CLI an option for you? If you have any questions how, please ping me!

@ArcherEmiya05
Copy link

ArcherEmiya05 commented Jun 24, 2024

Unfortunately I do not know an exact ETA yet, but it will definitely take a bit.

Currently the options are downgrading Gradle (might not work in your project), or using the CLI for CI integration (Help Article HowTo). Is using the CLI an option for you? If you have any questions how, please ping me!

Yes, I hope we can use your CLI as temporary replacement instead of gradle plugin for CI/CD pipeline so that incompatibility with Gradle will no longer be a problem.

@ArcherEmiya05
Copy link

ArcherEmiya05 commented Jun 25, 2024

@titze Does this command guardsquare scan app/build/outputs/apk/debug/app-debug.apk is equivalent to the plugin's uploadToAppSweepDebug gradle task as well as guardsquare scan app/build/outputs/bundle/release/app-release.aab to uploadToAppSweepReleaseBundle? If yes, does it also support accepting a download url instead of file assuming that the APK or AAB artifact is downloadable and hosted in a cloud storage?

Below is the setup we will have on the pipeline.

  script:
      - curl -sS https://platform.guardsquare.com/cli/install.sh | sh
      - export APPSWEEP_API_KEY=$APPSWEEP_API_KEY # Set AppSweep API key
      - guardsquare scan app/build/outputs/apk/debug/app-debug.apk # Perform static analysis

@titze
Copy link
Contributor

titze commented Jun 26, 2024

The commands are not quite equivalent, there are two things missing (at the moment) if you use the CLI like you do:

  • if the app is name-obfuscated (e.g. with R8), the Gradle plugin also uploads the mapping file so that AppSweep can show you the real location of problems, and not just a.a
  • the gradle plugin also collects information about the dependencies in your app, and uploads this to AppSweep. With this information, AppSweep can show you which problems are directly in your code, and which in dependencies (and in which). Without using the Gradle plugin, AppSweep tries to reconstruct this as best as it can, but it will not be accurate.

Did you find this helpful in AppSweep that we showed in which library / your code an issue was?

Re download URL:
This is not possible at the moment. In your setup I guess it wouldn't be difficult to just curl the apk before calling guardsquare scan?
Can you elaborate what your use-case is here? I am curious, because maybe this is something the CLI should indeed support natively, and I can put it on the roadmap.

@ArcherEmiya05
Copy link

ArcherEmiya05 commented Jun 26, 2024

The commands are not quite equivalent, there are two things missing (at the moment) if you use the CLI like you do:

  • if the app is name-obfuscated (e.g. with R8), the Gradle plugin also uploads the mapping file so that AppSweep can show you the real location of problems, and not just a.a
  • the gradle plugin also collects information about the dependencies in your app, and uploads this to AppSweep. With this information, AppSweep can show you which problems are directly in your code, and which in dependencies (and in which). Without using the Gradle plugin, AppSweep tries to reconstruct this as best as it can, but it will not be accurate.

Did you find this helpful in AppSweep that we showed in which library / your code an issue was?

Re download URL: This is not possible at the moment. In your setup I guess it wouldn't be difficult to just curl the apk before calling guardsquare scan? Can you elaborate what your use-case is here? I am curious, because maybe this is something the CLI should indeed support natively, and I can put it on the roadmap.

Just thought it would be a good feature to be able to accept url.

Anyway it seems that the plugin is still better approach than the CLI, really hope it get fixed for newer Gradle version. We do in fact use R8 in our code and AppSweep taking extra miles to check the used libraries is good as well.

@titze
Copy link
Contributor

titze commented Jun 26, 2024

I will keep you in the loop!

If the CLI would also offer the same functionality (mappingfile, libraries), would that be a problem for you?

Integration with Gradle is always a bit tricky, so not relying on it (much) might make integration a lot smoother.

@ArcherEmiya05
Copy link

ArcherEmiya05 commented Jun 26, 2024

I will keep you in the loop!

If the CLI would also offer the same functionality (mappingfile, libraries), would that be a problem for you?

Integration with Gradle is always a bit tricky, so not relying on it (much) might make integration a lot smoother.

If the CLI would also offer the same functionality (mappingfile, libraries), would that be a problem for you?

Just being able to include the mapping file would probably enough reason for us to permanently decommission the plugin in favor of CLI approach.

@titze
Copy link
Contributor

titze commented Jun 26, 2024

Ok, thanks for that info! I will ping you when I know more.

@titze
Copy link
Contributor

titze commented Jul 9, 2024

@ArcherEmiya05
actually if you only want to upload the mapping file, this is already possible:
guardsquare scan my_app.apk --mapping-file mapping.txt

Keep in mind that then the library information is deduced from the app itself, and is not as accurate as if you uploaded via thge Gradle plugin. That part is currently not possible (yet) with the CLI.
Essentially this means that some findings would look like they are from your own code, whereas in reality they could be from a library that you included.

@simonox
Copy link

simonox commented Oct 9, 2024

Are there any updates on that? We also updated our Gradle version.

@titze
Copy link
Contributor

titze commented Oct 9, 2024

Have you tried our cli tool? https://help.guardsquare.com/en/articles/161270-using-the-guardsquare-cli

Currently there is no update for the Gradle plugin unfortunately.

@G00fY2
Copy link
Author

G00fY2 commented Oct 9, 2024

Just in case this maybe helps some of you, this is how our Jenkins step looks:

def APPSWEEP_SCAN_MESSAGE = 'AppSweep scan not executed or failed'

stage('AppSweep upload') {
    when {
        expression { return isReleaseOrHotfixBranch() }
    }
    steps {
        echo '# Upload AAB to AppSweep'
        script {
            FAILED_STAGE = env.STAGE_NAME
        }
        script {
            String releaseAAB = sh(
                script: "find ./app/build/outputs/bundle/release/*.aab",
                returnStdout: true
            ).trim()
            String downloadUrl = "https://platform.guardsquare.com/cli/latest_linux_amd64"

            catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
                sh "mkdir -p \"$HOME/.guardsquare\""
                sh "curl --retry 2 --fail --show-error --silent --location $downloadUrl | tar -xvz -C \"$HOME/.guardsquare\""
                APPSWEEP_SCAN_MESSAGE = sh(
                    script: "$HOME/.guardsquare/guardsquare scan \"$releaseAAB\" --tag \"CI\"",
                    returnStdout: true
                ).trim()
            }
        }
    }
}

The APPSWEEP_SCAN_MESSAGE result is posted into our internal release chat in the final build step.

This way we don't need the AppSweep plugin at all.

@simonox
Copy link

simonox commented Oct 9, 2024

Yes, I switched to the command line. That one is working (at least on my machine / in my Docker container).

@Uma1r
Copy link

Uma1r commented Oct 21, 2024

Hi, are we any closer to resolving this as we've just upgraded our Gradle to 8.7 as well and had this error.

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

5 participants