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

Fix task ordering for upload task on AGP 3.5 #300

Merged
merged 1 commit into from
Sep 16, 2020

Conversation

fractalwrench
Copy link
Contributor

@fractalwrench fractalwrench commented Sep 16, 2020

Goal

Fixes the task ordering for the bugsnag upload tasks to enforce that it must run after the package task which produces the APK/AAB. This dependency was not explicitly specified and resulted in the JVM upload task failing with the following exception:

java.lang.IllegalStateException: Expected file collection to contain exactly one file, however, it contains no files.

This was caused by the fact that the JVM upload task on AGP 3.5 executed before the package task, and so the mapping file was not present. Explicitly adding a task ordering fixes this issue.

Changeset

  • When registering a task in BugsnagPlugin pass whether the task has been configured to run automatically to variant.register()
  • Remove registerAgp3/registerAgp4 methods as these do not have any function and appear to throw an exception on all tested AGP versions, resulting in a default fallback to registerManual
  • Wrap existing registerManual task dependencies in the autoRunTask flag, and configure the upload task to run automatically if required. This follows a similar approach to that taken in Fix task dependencies and order for BugsnagManifestUuidTask in AGP <4.1.0 #294

Testing

Enabled skipped E2E scenarios for AGP 3.5.

@fractalwrench fractalwrench merged commit 6ca2426 into next Sep 16, 2020
@fractalwrench fractalwrench deleted the PLAT-5038/AGP35-compat branch September 16, 2020 14:03
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

Successfully merging this pull request may close these issues.

None yet

2 participants