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

available-version-codes.txt not found after upgrading to the latest Bugsnag plugin #940

Closed
Egorand opened this issue Apr 20, 2021 · 10 comments
Labels
bug Indicates an unexpected problem or unintended behavior waiting-for-reply Indicates that an issue or pull request needs more information

Comments

@Egorand
Copy link

Egorand commented Apr 20, 2021

Describe the bug

I originally filed an issue against Bugsnag (bugsnag/bugsnag-android-gradle-plugin#383) but got told that this might be a gradle-play-publisher issue.

We're using gradle-play-publisher in combination with bugsnag-android-gradle-plugin. The setup for gradle-play-publisher looks like this:

if (gradle.startParameter.taskNames.contains("publishInternalReleaseBundle")) {
  apply plugin: 'com.github.triplet.play'
  play {
    track = 'production'
    serviceAccountCredentials = file("${System.getenv("SECRETS_PATH")}/play.json")
    resolutionStrategy = com.github.triplet.gradle.androidpublisher.ResolutionStrategy.AUTO
  }
}

After upgrading bugsnag-android-gradle-plugin to version 5.7.5 we started seeing the following error whenever publishInternalReleaseBundle is invoked:

* What went wrong:
Could not determine the dependencies of task ':app:publishInternalReleaseBundle'.
> Could not create task ':app:uploadBugsnagInternal-releaseMapping'.
   > java.io.FileNotFoundException: /Users/.../app/build/intermediates/gpp/internalRelease/available-version-codes.txt (No such file or directory)

The issue is reproducible locally with:

./gradlew publishInternalReleaseBundle --dry-run

The theory is that a recent change (potentially this one: bugsnag/bugsnag-android-gradle-plugin#375) in Bugsnag's plugin is triggering premature initialization of gradle-play-publisher in the wrong build phase, but I'm hoping to get some help troubleshooting this.

Versions

  • Gradle Play Publisher: 3.4.0
  • Gradle Wrapper: 6.8.3
  • Android Gradle Plugin: 4.1.3

Tasks executed

./gradlew publishInternalReleaseBundle --dry-run

Expected behavior

The plugin doesn't look up the available-version-codes.txt during configuration phase, which IIUC isn't supposed to be there that early.

Additional context (if a crash, provide stack trace)

Full stacktrace

* Exception is:
org.gradle.api.internal.tasks.TaskDependencyResolveException: Could not determine the dependencies of task ':app:publishInternalReleaseBundle'.
        at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.getDependencies(CachingTaskDependencyResolveContext.java:71)
        at org.gradle.execution.plan.TaskDependencyResolver.resolveDependenciesFor(TaskDependencyResolver.java:46)
        at org.gradle.execution.plan.LocalTaskNode.getDependencies(LocalTaskNode.java:155)
        at org.gradle.execution.plan.LocalTaskNode.resolveDependencies(LocalTaskNode.java:123)
        at org.gradle.execution.plan.DefaultExecutionPlan.doAddNodes(DefaultExecutionPlan.java:171)
        at org.gradle.execution.plan.DefaultExecutionPlan.addEntryTasks(DefaultExecutionPlan.java:135)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph.addEntryTasks(DefaultTaskExecutionGraph.java:160)
        at org.gradle.execution.TaskNameResolvingBuildConfigurationAction.configure(TaskNameResolvingBuildConfigurationAction.java:49)
        at org.gradle.execution.DefaultBuildConfigurationActionExecuter.configure(DefaultBuildConfigurationActionExecuter.java:55)
        at org.gradle.execution.DefaultBuildConfigurationActionExecuter.access$000(DefaultBuildConfigurationActionExecuter.java:26)
        at org.gradle.execution.DefaultBuildConfigurationActionExecuter$1.proceed(DefaultBuildConfigurationActionExecuter.java:63)
        at org.gradle.execution.DefaultTasksBuildExecutionAction.configure(DefaultTasksBuildExecutionAction.java:45)
        at org.gradle.execution.DefaultBuildConfigurationActionExecuter.configure(DefaultBuildConfigurationActionExecuter.java:55)
        at org.gradle.execution.DefaultBuildConfigurationActionExecuter.access$000(DefaultBuildConfigurationActionExecuter.java:26)
        at org.gradle.execution.DefaultBuildConfigurationActionExecuter$1.proceed(DefaultBuildConfigurationActionExecuter.java:63)
        at org.gradle.execution.ExcludedTaskFilteringBuildConfigurationAction.configure(ExcludedTaskFilteringBuildConfigurationAction.java:48)
        at org.gradle.execution.DefaultBuildConfigurationActionExecuter.configure(DefaultBuildConfigurationActionExecuter.java:55)
        at org.gradle.execution.DefaultBuildConfigurationActionExecuter.lambda$select$0(DefaultBuildConfigurationActionExecuter.java:42)
        at org.gradle.internal.Factories$1.create(Factories.java:31)
        at org.gradle.api.internal.project.DefaultProjectStateRegistry.withMutableStateOfAllProjects(DefaultProjectStateRegistry.java:141)
        at org.gradle.api.internal.project.DefaultProjectStateRegistry.withMutableStateOfAllProjects(DefaultProjectStateRegistry.java:128)
        at org.gradle.execution.DefaultBuildConfigurationActionExecuter.select(DefaultBuildConfigurationActionExecuter.java:40)
        at org.gradle.initialization.DefaultTaskExecutionPreparer.prepareForTaskExecution(DefaultTaskExecutionPreparer.java:38)
        at org.gradle.initialization.BuildOperationFiringTaskExecutionPreparer$CalculateTaskGraph.populateTaskGraph(BuildOperationFiringTaskExecutionPreparer.java:117)
        at org.gradle.initialization.BuildOperationFiringTaskExecutionPreparer$CalculateTaskGraph.run(BuildOperationFiringTaskExecutionPreparer.java:68)
        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.initialization.BuildOperationFiringTaskExecutionPreparer.prepareForTaskExecution(BuildOperationFiringTaskExecutionPreparer.java:56)
        at org.gradle.initialization.DefaultGradleLauncher.prepareTaskExecution(DefaultGradleLauncher.java:233)
        at org.gradle.initialization.DefaultGradleLauncher.doClassicBuildStages(DefaultGradleLauncher.java:167)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:148)
        at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:124)
        at org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:72)
        at org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:67)
        at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:213)
        at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:67)
        at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:56)
        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:31)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:63)
        at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
        at org.gradle.tooling.internal.provider.FileSystemWatchingBuildActionRunner.run(FileSystemWatchingBuildActionRunner.java:77)
        at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:41)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:49)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:44)
        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.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:44)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.lambda$execute$0(InProcessBuildActionExecuter.java:54)
        at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:86)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:53)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:29)
        at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.lambda$execute$0(BuildTreeScopeLifecycleBuildActionExecuter.java:33)
        at org.gradle.internal.buildtree.BuildTreeState.run(BuildTreeState.java:49)
        at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.execute(BuildTreeScopeLifecycleBuildActionExecuter.java:32)
        at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.execute(BuildTreeScopeLifecycleBuildActionExecuter.java:27)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:104)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:55)
        at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:64)
        at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:37)
        at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.lambda$execute$0(SessionScopeLifecycleBuildActionExecuter.java:54)
        at org.gradle.internal.session.BuildSessionState.run(BuildSessionState.java:67)
        at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.execute(SessionScopeLifecycleBuildActionExecuter.java:50)
        at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.execute(SessionScopeLifecycleBuildActionExecuter.java:36)
        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:59)
        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:31)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:41)
        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:47)
        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:31)
        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:65)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
        at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:39)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
        at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:29)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
        at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:35)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:78)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:75)
        at org.gradle.util.Swapper.swap(Swapper.java:38)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:75)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
        at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:63)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:84)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52)
        at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreationException: Could not create task ':app:uploadBugsnagInternal-releaseMapping'.
        at org.gradle.api.internal.tasks.DefaultTaskContainer.taskCreationException(DefaultTaskContainer.java:719)
        at org.gradle.api.internal.tasks.DefaultTaskContainer.access$600(DefaultTaskContainer.java:77)
        at org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreatingProvider.domainObjectCreationException(DefaultTaskContainer.java:711)
        at org.gradle.api.internal.DefaultNamedDomainObjectCollection$AbstractDomainObjectCreatingProvider.tryCreate(DefaultNamedDomainObjectCollection.java:948)
        at org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreatingProvider.access$1401(DefaultTaskContainer.java:658)
        at org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreatingProvider$1.run(DefaultTaskContainer.java:684)
        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.DefaultTaskContainer$TaskCreatingProvider.tryCreate(DefaultTaskContainer.java:680)
        at org.gradle.api.internal.DefaultNamedDomainObjectCollection$AbstractDomainObjectCreatingProvider.calculateOwnValue(DefaultNamedDomainObjectCollection.java:929)
        at org.gradle.api.internal.provider.AbstractMinimalProvider.getOrNull(AbstractMinimalProvider.java:93)
        at org.gradle.api.internal.DefaultNamedDomainObjectCollection.findByName(DefaultNamedDomainObjectCollection.java:295)
        at org.gradle.api.internal.tasks.DefaultTaskContainer.findByName(DefaultTaskContainer.java:562)
        at org.gradle.api.internal.tasks.DefaultTaskContainer.findByPath(DefaultTaskContainer.java:469)
        at org.gradle.api.internal.tasks.DefaultTaskContainer.getByPath(DefaultTaskContainer.java:492)
        at org.gradle.api.internal.tasks.DefaultTaskContainer.resolveTask(DefaultTaskContainer.java:487)
        at org.gradle.api.internal.tasks.DefaultTaskDependency.visitDependencies(DefaultTaskDependency.java:139)
        at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext$TaskGraphImpl.getNodeValues(CachingTaskDependencyResolveContext.java:114)
        at org.gradle.internal.graph.CachingDirectedGraphWalker$GraphWithEmptyEdges.getNodeValues(CachingDirectedGraphWalker.java:213)
        at org.gradle.internal.graph.CachingDirectedGraphWalker.doSearch(CachingDirectedGraphWalker.java:121)
        at org.gradle.internal.graph.CachingDirectedGraphWalker.findValues(CachingDirectedGraphWalker.java:73)
        at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.getDependencies(CachingTaskDependencyResolveContext.java:69)
        ... 114 more
Caused by: org.gradle.api.UncheckedIOException: java.io.FileNotFoundException: /Users/.../app/build/intermediates/gpp/internalRelease/available-version-codes.txt (No such file or directory)
        at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:61)
        at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:41)
        at org.gradle.api.internal.provider.AbstractProperty.doCalculateValue(AbstractProperty.java:138)
        at org.gradle.api.internal.provider.AbstractProperty.calculateOwnValue(AbstractProperty.java:127)
        at org.gradle.api.internal.provider.AbstractMinimalProvider.getOrElse(AbstractMinimalProvider.java:98)
        at com.android.build.gradle.internal.api.ApkVariantOutputImpl.getVersionCode(ApkVariantOutputImpl.java:172)
        at com.android.build.gradle.internal.api.ApkVariantOutputImpl_Decorated.getVersionCode(Unknown Source)
        at com.bugsnag.android.gradle.BugsnagPlugin$registerUploadProguardTask$1.invoke(BugsnagPlugin.kt:439)
        at com.bugsnag.android.gradle.BugsnagPlugin$registerUploadProguardTask$1.invoke(BugsnagPlugin.kt:60)
        at com.bugsnag.android.gradle.internal.GradleUtilKt$sam$i$org_gradle_api_Action$0.execute(GradleUtil.kt)
        at org.gradle.api.internal.DefaultMutationGuard$2.execute(DefaultMutationGuard.java:44)
        at org.gradle.api.internal.DefaultMutationGuard$2.execute(DefaultMutationGuard.java:44)
        at org.gradle.configuration.internal.DefaultUserCodeApplicationContext$CurrentApplication$1.execute(DefaultUserCodeApplicationContext.java:100)
        at org.gradle.api.internal.DefaultCollectionCallbackActionDecorator$BuildOperationEmittingAction$1.run(DefaultCollectionCallbackActionDecorator.java:95)
        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.DefaultCollectionCallbackActionDecorator$BuildOperationEmittingAction.execute(DefaultCollectionCallbackActionDecorator.java:92)
        at org.gradle.internal.ImmutableActionSet$SetWithManyActions.execute(ImmutableActionSet.java:329)
        at org.gradle.api.internal.DefaultDomainObjectCollection.doAdd(DefaultDomainObjectCollection.java:264)
        at org.gradle.api.internal.DefaultNamedDomainObjectCollection.doAdd(DefaultNamedDomainObjectCollection.java:113)
        at org.gradle.api.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.java:258)
        at org.gradle.api.internal.DefaultNamedDomainObjectCollection$AbstractDomainObjectCreatingProvider.tryCreate(DefaultNamedDomainObjectCollection.java:944)
        ... 140 more
Caused by: java.io.FileNotFoundException: /Users/.../app/build/intermediates/gpp/internalRelease/available-version-codes.txt (No such file or directory)
        at kotlin.io.FilesKt__FileReadWriteKt.forEachLine(FileReadWrite.kt:190)
        at kotlin.io.FilesKt__FileReadWriteKt.readLines(FileReadWrite.kt:219)
        at kotlin.io.FilesKt__FileReadWriteKt.readLines$default(FileReadWrite.kt:217)
        at com.github.triplet.gradle.play.PlayPublisherPlugin$applyInternal$1$2$7.transform(PlayPublisherPlugin.kt:336)
        at com.github.triplet.gradle.play.PlayPublisherPlugin$applyInternal$1$2$7.transform(PlayPublisherPlugin.kt:59)
        at org.gradle.api.internal.provider.TransformBackedProvider.mapValue(TransformBackedProvider.java:73)
        at org.gradle.api.internal.provider.TransformBackedProvider.calculateOwnValue(TransformBackedProvider.java:65)
        at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateValue(AbstractMinimalProvider.java:103)
        at org.gradle.api.internal.provider.MappingProvider.calculateOwnValue(MappingProvider.java:55)
        at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateValue(AbstractMinimalProvider.java:103)
        at org.gradle.api.internal.provider.DefaultProperty.calculateValueFrom(DefaultProperty.java:128)
        at org.gradle.api.internal.provider.DefaultProperty.calculateValueFrom(DefaultProperty.java:25)
        at org.gradle.api.internal.provider.AbstractProperty.doCalculateValue(AbstractProperty.java:133)
        ... 167 more

@SUPERCILEX
Copy link
Collaborator

Yeah, the problem is these changes: bugsnag/bugsnag-android-gradle-plugin@27592a9#diff-0b3ba5e394543c53bbd77a52b87f07c4ff12e47518f2f3b26f1cd28f8246d7fc. They're using the old ApkVariantOutput which forces the version code to be resolved. They'd need to switch to the Provider based API.

@Egorand
Copy link
Author

Egorand commented Apr 20, 2021

Thanks for taking a look @SUPERCILEX! cc @yousif-bugsnag

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent
activity. It will be closed if no further activity occurs. Thank you for your
contributions.

@github-actions github-actions bot added the waiting-for-reply Indicates that an issue or pull request needs more information label Apr 28, 2021
@github-actions github-actions bot closed this as completed May 6, 2021
@n-kulic
Copy link

n-kulic commented Aug 3, 2022

I'm getting same error when running gradle tasks such as ./gradlew clean, triplet plugin is called on gradle clean task and throwing error because available-version-codes.txt does not exists

-FAILURE: Build failed with an exception.

* Where:
Script '/Users/hivetechltd/Documents/human/roto-native/node_modules/@sentry/react-native/sentry.gradle' line: 167

* What went wrong:
java.io.FileNotFoundException: /Users/User/Documents/react-native/myapp/android/app/build/intermediates/gpp/release/available-version-codes.txt (No such file or directory)
> /Users/User/Documents/react-native/myapp/android/app/build/intermediates/gpp/release/available-version-codes.txt (No such file or directory)

Problem happened after I upgraded react-native version, which requires a new gradle version as well (7.3 compared to previous 6.5) and since I was using older version of gradle-play-publisher plugin (2.2.1), i was getting an error when running ./gradlew publishBundle:

-* What went wrong:
A problem was found with the configuration of task ':app:publishReleaseBundle' (type 'PublishBundle').
  - In plugin 'com.github.triplet.play' type 'com.github.triplet.gradle.play.tasks.PublishBundle' property 'outputDir' is annotated with @PathSensitive but that is not allowed for 'OutputDirectory' properties.
    
    Reason: This modifier is used in conjunction with a property of type 'OutputDirectory' but this doesn't have semantics.
    
    Possible solution: Remove the '@PathSensitive' annotation.
    
    Please refer to https://docs.gradle.org/7.3.3/userguide/validation_problems.html#incompatible_annotations for more details about this problem.

I have no choice now but to update triplet plugin which i did and now i get same error situation as with Bugsnag plugin in this github issue, although in my situation it is issue with sentry package

@SUPERCILEX How can it be that it works well with older version of gradle-play-publisher (2.2.1), sentry plugin does not trigger triplet plugin and it works well.
Is there any quick solution for this case? I see no other options but to keep older version of react-native which uses older gradle version.
Or perhaps would a patch be consideration or it is not something quick and simple to do?

@darrylyoung
Copy link

Hi, @n-kulic. Were you able to resolve this issue? I just started helping out on a React Native project (running 0.67.4), and I'm seeing the following issue since upgrading @sentry/react-native from 4.2.0 to 4.8.0:

* What went wrong:
java.io.FileNotFoundException: /Users/.../android/app/build/intermediates/gpp/release/available-version-codes.txt (No such file or directory)
> /Users/.../android/app/build/intermediates/gpp/release/available-version-codes.txt (No such file or directory)

The app is using Gradle Play Publisher like this.

app/build.gradle

plugins {
  id("com.android.application")
  id("com.github.triplet.play")
}

build.gradle

...

dependencies {
  classpath('com.android.tools.build:gradle:4.2.2')
  classpath "com.github.triplet.gradle:play-publisher:3.7.0-agp4.2"
}

I'm new to Gradle Play Publisher, and still figuring out the app, but any pointers would be much appreciated. Thanks!

@n-kulic
Copy link

n-kulic commented Nov 4, 2022

@darrylyoung I used com.github.triplet.play version 2.3.0 (Had issues with latest versions)

And in android/build.gradle i used these versions:

 classpath("com.android.tools.build:gradle:7.1.1")
 classpath("de.undercouch:gradle-download-task:5.0.1")

@darrylyoung
Copy link

Thanks, @n-kulic. That's much appreciated. I'll give it a go.

@Legion2
Copy link

Legion2 commented Feb 26, 2023

This is still a problem with version 3.8.1

@Legion2
Copy link

Legion2 commented Mar 19, 2023

I have created an issue in the sentry-react-native project, because I think they have to implement a fix for this.

@bpappin-atimi
Copy link

I'm having this issue and we are not using react native or bugsnag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior waiting-for-reply Indicates that an issue or pull request needs more information
Projects
None yet
Development

No branches or pull requests

6 participants