Skip to content

chore: upgrade to agp 9 and configure parallelism #1114

Description

@ovitrif

Parent: #1113
Depends on: #1115

Goal

Upgrade Bitkit Android to the stable AGP 9 toolchain, adopt built-in Kotlin and the public AGP DSL, replace internal variant/output hooks with supported artifact APIs, and explicitly enable Gradle task and Android Studio Tooling API parallelism.

Preparation

  • Update Android CLI and install or refresh the official agp-9-upgrade skill before refinement and implementation.
  • Use the skill's current AGP 9 migration guidance and primary Android documentation retrieved through android docs as the implementation contract.
  • Start from chore: update kotlin and compose bom #1115's landed Kotlin/Compose baseline and run Android Studio's AGP Upgrade Assistant from that current master state.

Compatibility matrix

Component Required state
Android Gradle Plugin 9.3.0
Gradle 9.5.0
JDK CI 17; Android Studio JetBrains Runtime 21
Kotlin / Compose BOM Consume the versions landed by #1115; Kotlin 2.3.21 or newer
KSP 2.3.10
Hilt 2.60.1
SDK compile/target 36; min 28
JVM target 11
NDK default 28.1.13356709 with NDK_VERSION override

Deliverables

Toolchain and public DSL

  • Run Android Studio's AGP Upgrade Assistant from the landed chore: update kotlin and compose bom #1115 baseline and retain its report in the PR evidence.
  • Upgrade AGP, Gradle wrapper, KSP, and Hilt to the matrix above.
  • Remove org.jetbrains.kotlin.android; retain the Compose compiler and serialization plugins.
  • Move compiler configuration to built-in Kotlin's supported kotlin.compilerOptions DSL while preserving -XXLanguage:+PropertyParamAnnotationDefaultTargetMode and JVM 11.
  • Keep buildFeatures.buildConfig = true; enable buildFeatures.resValues = true.
  • Adopt AGP 9 built-in Kotlin and the new public DSL directly.
  • Replace all com.android.build.gradle.internal and applicationVariants integrations.

Generated values

  • Move repository-defined BuildConfig values to androidComponents.onVariants through public BuildConfigField providers.
  • Preserve E2E, E2E_BACKEND, E2E_HOMEGATE_URL, TREZOR_BRIDGE, TREZOR_BRIDGE_URL, GEO, FEATURE_PAYKIT_UI_DISABLED, LOCALES, and flavor-specific NETWORK.
  • Preserve dev/mainnet/tnet app_name resources and tracked, lazy provider inputs.

Public artifact collection

  • Replace BaseVariantOutputImpl, FinalizeBundleTask, and applicationVariants.all output renaming.
  • Read APK metadata through SingleArtifact.APK and BuiltArtifactsLoader; read AABs through SingleArtifact.BUNDLE.
  • Keep AGP-native outputs and publish deterministic copies under app/build/outputs/bitkit/<variant>/:
    • bitkit-{flavor}-{buildType}-{versionCode}-{abi}.apk
    • bitkit-{flavor}-{buildType}-{versionCode}.aab
  • Derive universal, armeabi-v7a, arm64-v8a, and debug x86_64 names from AGP metadata.
  • Declare task inputs/outputs and retain configuration-cache and build-cache compatibility.

Consumers and build properties

  • Update just run, just release, E2E workflows, internal/stable release workflows, directly coupled README/release-command paths, and focused build-contract tests.
  • Preserve signing, ABI filters, stripping checks, native debug symbols, signatures, checksums, and Play/GitHub publication names.
  • Use these properties exactly once:
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.tooling.parallel=true
org.gradle.caching=true
org.gradle.configuration-cache=true

Acceptance criteria

  • Android Studio sync succeeds after the Upgrade Assistant migration.
  • ./gradlew --version reports Gradle 9.5.0 on JDK 17.
  • The catalog reports AGP 9.3.0, KSP 2.3.10, Hilt 2.60.1, and the Kotlin/Compose versions landed by chore: update kotlin and compose bom #1115.
  • Build logic no longer applies org.jetbrains.kotlin.android or uses internal/legacy AGP variant APIs.
  • Existing BuildConfig and flavor resources match the AGP 8 baseline for every flavor.
  • Assemble/bundle tasks produce native artifacts and publication copies with the established names.
  • ./gradlew help --warning-mode=all reports no repository-owned toolchain deprecations.
  • ./gradlew build --dry-run resolves dev, tnet, and mainnet variants.
  • Two consecutive ./gradlew help runs store and reuse the configuration cache.
  • Android Studio sync succeeds with Tooling API parallelism explicitly enabled.
  • just compile, just test, just lint, just build, and just test android pass.
  • The dev smoke journey, local E2E, and release artifact/signature/symbol/checksum validation pass.
  • actionlint passes for workflow edits.
  • GitHub-hosted CI, E2E, internal-release, and stable-release paths consume the collected outputs in workflows triggered after merge.

References

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions