Skip to content

fix: restore E2E APK discovery after AGP 9 migration #1128

Description

@ovitrif

Why this is required

Before AGP 9, the app build renamed APKs and AABs inside AGP's output directories through applicationVariants, BaseVariantOutputImpl.outputFileName, and FinalizeBundleTask. AGP 9 removes those legacy and internal APIs. There is no supported way to keep writing the established bitkit-* names into AGP's native output directories.

#1127 replaces them with the supported SingleArtifact.APK, SingleArtifact.BUNDLE, and BuiltArtifactsLoader APIs. The resulting artifact-listener tasks run whenever Gradle produces the corresponding app artifact, including direct assemble* and bundle* commands, and publish copies under app/build/outputs/bitkit/<variant>/. Dependent consumers that still search the old AGP paths must update with that producer move.

Producer contract

  • Every assemble<Variant> invocation automatically publishes the established versioned bitkit-*.apk copies under app/build/outputs/bitkit/<variant>.
  • Every bundle<Variant> invocation automatically publishes the established versioned bitkit-*.aab copy under app/build/outputs/bitkit/<variant>.
  • The artifact-listener wiring is the build trigger for these compatibility outputs across direct Gradle commands, Android Studio builds, just commands, and CI.
  • Each compatibility directory contains only the current APK or AAB set for its variant.
  • AGP's native app-* artifacts and metadata remain owned by AGP under app/build/outputs/apk and app/build/outputs/bundle.

Consumer delivery

Update the two consumers against the AGP 9 producer path. Track both changes through this issue.

Consumers hard-cut to the new compatibility directory. A dual-path legacy fallback is not required: the old in-place rename contract cannot be preserved under AGP 9, and coordinating the consumer updates with #1127 is enough.

Delivery order

  1. Land the bitkit-e2e-tests compatibility update (fix: locate apk in agp 9 output dir bitkit-e2e-tests#203), ideally on a same-named branch as the android PR until merge.
  2. Land the bitkit-nightly compatibility update (synonymdev/bitkit-nightly#45).
  3. Merge chore: upgrade to agp 9 and configure parallelism #1127 once in-repo consumers are updated and the external consumer PRs/issues above are ready to land with it.
  4. Close this issue after both external consumer paths have run successfully against the merged AGP 9 producer.

Acceptance criteria

  • Direct ./gradlew assembleDevDebug publishes exactly one bitkit-dev-debug-*-universal.apk under app/build/outputs/bitkit/devDebug.
  • Direct ./gradlew assembleMainnetDebug publishes exactly one bitkit-mainnet-debug-*-universal.apk under app/build/outputs/bitkit/mainnetDebug.
  • Direct ./gradlew bundleMainnetRelease publishes exactly one current bitkit-mainnet-release-*.aab under app/build/outputs/bitkit/mainnetRelease.
  • The bitkit-e2e-tests Android build helper succeeds against an AGP 9 android ref for local, regtest, and mainnet builds.
  • Each E2E helper build writes the expected APK under aut/.
  • The bitkit-nightly mainnet probe reaches the upload step with probe-apk/bitkit_e2e.apk present against an AGP 9 android ref.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions