Skip to content

chore(android): AGP 8.9 + Gradle 8.11 ahead of the API 36 bump (ENG-605) - #733

Merged
islandbitcoin merged 1 commit into
mainfrom
chore/eng-605-android-toolchain
Sep 24, 2026
Merged

islandbitcoin merged 1 commit into
mainfrom
chore/eng-605-android-toolchain

Conversation

@islandbitcoin

Copy link
Copy Markdown
Contributor

PR1 of the ENG-605 sequence: move the Android toolchain forward so the API 36 bump lands on a supported plugin. SDK levels unchanged; PR2 bumps the libs that hardcode compileSdk < 36.

What changed

before after
Android Gradle Plugin 8.7.2 8.9.3 (latest 8.9.x)
Gradle wrapper 8.10.2 8.11.1 (AGP 8.9 minimum), distributionSha256Sum now pinned
com.android.tools:r8 classpath pin + r8-releases maven repo 8.7.18 removed
android.aapt2Version=8.6.1-11315950 (gradle.properties + .example) pinned removed
Kotlin / NDK / compileSdk / targetSdk / minSdk 2.0.21 / 27.1.12297006 / 35 / 35 / 26 unchanged

Why drop the R8 pin: introduced with breez-sdk-liquid (#248) and bumped in #622 to 8.7.18, i.e. exactly what AGP 8.7.2 bundles, so it was already a no-op. No comment recorded a reason. Note release builds have enableProguardInReleaseBuilds = false, so R8 shrinking is off anyway; only D8 dexing runs.

Why drop the aapt2 pin: added in #441 (targetSdk 35 bump) with no recorded reason, and android-deploy.yml already generates a gradle.properties without it for every release build.

android/app/build.gradle (required companion change): AGP 8.8+ no longer routes the app's configureCMake* tasks through every library's preBuild. Autolinked libraries that ship codegen specs but no native code (react-native-config, async-storage, clipboard, netinfo, ...) therefore have no build/generated/source/codegen/jni/ yet when the app's CMake configure runs, and RN 0.77's generated Android-autolinking.cmake add_subdirectory()s those dirs unconditionally:

Execution failed for task ':app:configureCMakeRelWithDebInfo[arm64-v8a]'.
add_subdirectory given source ".../react-native-config/android/build/generated/source/codegen/jni/" which is not an existing directory.

Fix: the app's configureCMake* tasks now depend on every library's generateCodegenArtifactsFromSchema. Verified on the same tree: builds on AGP 8.7.2, fails on 8.9.3 without the edge, builds on 8.9.3 with it. (Upstream RN only guards the missing dirs, react/react-native#56886, which would silently drop those TurboModules from a real build; the ordering edge is the actual fix.)

Why now

AGP 8.9 is the floor for compileSdk 36 work (PR2). Doing the plugin/wrapper move in its own PR keeps the SDK bump diff reviewable and makes any build regression attributable.

Build proof (local, macOS arm64, JDK 17.0.19, Node 24)

cd android && ./gradlew --version                     # Gradle 8.11.1, sha256 validated
npx react-native bundle --platform android --dev false --entry-file index.js \
  --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
./android/gradlew -b ./android/build.gradle assembleRelease -PreactNativeArchitectures=arm64-v8a \
  -Dorg.gradle.jvmargs=-Xmx4g --warning-mode all \
  -PMYAPP_UPLOAD_STORE_FILE=$HOME/.android/debug.keystore -PMYAPP_UPLOAD_STORE_PASSWORD=android \
  -PMYAPP_UPLOAD_KEY_ALIAS=androiddebugkey -PMYAPP_UPLOAD_KEY_PASSWORD=android

Result: BUILD SUCCESSFUL in 4m 40s, 2223 tasks. android/app/build/outputs/apk/release/app-arm64-v8a-release.apk = 105,062,656 bytes (debug-keystore signed; the tracked gradle.properties points at a release keystore not present locally, hence the -P overrides). yarn tsc:check clean. Generated bundle + drawable-* assets were not committed.

Warnings seen (AGP 8.9.3 / Gradle 8.11.1, --warning-mode all)

  • RepositoryHandler.jcenter() deprecated, removed in Gradle 9.0 (6x, from third-party library build.gradles, not ours).
  • buildToolsVersion '31.0.0' / '33.0.0' ignored, below AGP 8.9's minimum 35.0.0 (two libraries; harmless, worth cleaning in PR2).
  • Kotlin deprecation warnings inside react-native-webview, Some input files use or override a deprecated API (javac) - library code, unchanged by this PR.
  • Specifying custom build file location (-b) deprecated for Gradle 9.0 - from the local invocation style only; CI runs cd android && ./gradlew ....

No AGP 9.0 removal warnings originate from this repo's own Gradle files.

CI

build-check.yml and android-deploy.yml use setup-java@v4 (17) + android-actions/setup-android@v3 + the wrapper; neither pins a Gradle or AGP version, so nothing needs to change. build-check.yml copies gradle.properties.example, which is updated here too.

🤖 Generated with Claude Code

PR1 of the ENG-605 sequence: move the Android toolchain forward so the
compileSdk/targetSdk 36 bump (PR2+) lands on a supported plugin. SDK
levels are unchanged in this PR (compileSdk/targetSdk stay 35, minSdk
26, Kotlin 2.0.21, NDK 27.1.12297006).

- Android Gradle Plugin 8.7.2 -> 8.9.3 (latest 8.9.x)
- Gradle wrapper 8.10.2 -> 8.11.1 (AGP 8.9 minimum), with the
  distribution sha256 pinned
- drop the explicit com.android.tools:r8 classpath pin and the
  r8-releases maven repo: the pin was introduced with breez-sdk-liquid
  (#248) and kept in lockstep with the AGP-bundled R8 (#622 bumped it to
  8.7.18 = AGP 8.7.2's own), so it was a no-op; AGP 8.9.3 resolves its
  bundled R8 on its own
- drop android.aapt2Version=8.6.1-11315950 (gradle.properties and the
  .example): added in #441 for the targetSdk 35 bump with no recorded
  reason, and android-deploy.yml already builds release without it
- android/app/build.gradle: make the app's configureCMake* tasks depend
  on every library's generateCodegenArtifactsFromSchema. AGP 8.8+ no
  longer routes configureCMake through each library's preBuild, so
  codegen-only autolinked libs (react-native-config, async-storage,
  clipboard, netinfo, ...) had no codegen/jni dir yet when the app's
  CMake configure ran and RN 0.77's Android-autolinking.cmake failed
  with "add_subdirectory given source ... not an existing directory".
  Verified: same tree builds on AGP 8.7.2, fails on 8.9.3 without this
  edge, builds on 8.9.3 with it.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@linear

linear Bot commented Sep 24, 2026

Copy link
Copy Markdown

ENG-605

@islandbitcoin
islandbitcoin merged commit c247344 into main Sep 24, 2026
9 checks passed
islandbitcoin added a commit that referenced this pull request Sep 24, 2026
ENG-605 PR3. Stacked on #733 (AGP 8.9.3 / Gradle 8.11.1) and #735
(every native dependency now inherits rootProject.ext), so this is the
two-line bump those prepared for:

- compileSdkVersion 35 -> 36
- buildToolsVersion 35.0.0 -> 36.0.0

targetSdkVersion stays at 35 (PR5), minSdkVersion unchanged, so there is
no runtime behaviour change: the app is compiled against the API 36
headers but Android still applies API 35 compatibility behaviour.

AGP 8.9.3 supports compileSdk 36 natively; no
android.suppressUnsupportedCompileSdk entry was needed in
gradle.properties. CI is unchanged: both Android workflows install only
platform-tools and let Gradle fetch the pinned platform/build-tools.

Verified locally (platforms;android-36 + build-tools;36.0.0):
assembleRelease and assembleDebug (arm64-v8a) BUILD SUCCESSFUL, all 8
libraries that print a compileSdk report "using custom value: 36";
yarn tsc:check clean; yarn test 1161 passed.

Co-authored-by: Dread <[email protected]>
Co-authored-by: Claude Fable 5.1 <[email protected]>
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.

1 participant