Skip to content

ci: compile a React Native 0.87 app on AGP 9 with and without built-in Kotlin - #1940

Open
AlvaroBrey wants to merge 3 commits into
mainfrom
agp9-smoke-test
Open

ci: compile a React Native 0.87 app on AGP 9 with and without built-in Kotlin#1940
AlvaroBrey wants to merge 3 commits into
mainfrom
agp9-smoke-test

Conversation

@AlvaroBrey

@AlvaroBrey AlvaroBrey commented Sep 3, 2026

Copy link
Copy Markdown
Member
  • Adds e2e-tests/AGP9TestApp, the Android project of a stock React Native 0.87.1 app that autolinks react-native-purchases and react-native-purchases-ui from the repo. RN 0.87 is the first release whose Gradle plugin pins AGP 9.
  • New agp9_test_app_android CircleCI job runs :app:compileDebugKotlin twice: once with the template's gradle.properties (android.builtInKotlin=false, android.newDsl=false), once with both flags on, which is what AGP 10 forces.
  • Covers both sides of the kotlin-android guard from [EXTERNAL] fix(android): skip explicit Kotlin plugin when AGP registers the kotlin extension #1934 in a real app: configuration, autolinking, and compiling the modules' Kotlin under KGP 2.2 and under AGP's built-in Kotlin.
  • Release hold waits on the new job.
  • No JS, no APK: the app's package.json carries only react-native and the CLI packages autolinking needs, and the job stops at Kotlin compilation, so no NDK, dexing or packaging.

Checklist

  • A description about what and why you are contributing, even if it's trivial.
  • The issue number(s) or PR number(s) in the description if you are contributing in response to those.
  • If applicable, unit tests.
Agent description

Motivation

#1934 made both Android modules configure under AGP 9, verified by hand on an Expo SDK 58 / RN 0.87 app. Nothing in CI runs AGP 9: every job builds an example app, and the RN Gradle plugin picks AGP from the RN version (0.78 pins 8.8, 0.86 pins 8.12, 0.87 pins 9.2.1). All apps in the repo are on 0.78 to 0.86.

Description

  • AGP9TestApp is npx @react-native-community/cli init --version 0.87.1 with everything the Gradle build does not read removed: iOS, the JS entry point and Metro/Babel/TS config, Jest, ESLint, Prettier, launcher icons, release signing. Standalone package with its own yarn.lock, like examples/adsTester, since the root workspace is on RN 0.78.
  • react-native.config.js points autolinking at the two module roots, the same way e2e-tests/MaestroTestApp does. Nothing is published or symlinked.
  • gradle.properties keeps the template's android.builtInKotlin=false / android.newDsl=false; the second CI build overrides both with -P. reactNativeArchitectures=x86_64 to keep the NDK build short.
  • The template's own app/build.gradle hardcodes apply plugin: "org.jetbrains.kotlin.android" and fails with the flags on before reaching our modules, so it gets the same findByName('kotlin') guard. That is the one edit to the generated Android project besides gradle.properties.
  • Not visible in the diff: the stock RN 0.87 template opts out of built-in Kotlin and the new DSL. Expo SDK 58 opts in, so both configurations are what real apps ship today.

Regression gates

Rejected:

  • A Gradle-only fixture evaluating the two module build scripts under a pinned AGP 9 (what this PR started as, modelled on purchases-flutter#1765). Configuration-time only: it could not compile the modules, and it had to re-implement the RN Gradle plugin's namespace handling to get the main module to configure at all.
  • Bumping MaestroTestApp to RN 0.87: it is the app the Maestro E2E suite runs on, and coupling the two makes both harder to change.

Limitations: compileSdkVersion, targetSdkVersion, versionCode and lintOptions in both modules are deprecated on AGP 9 and removed in AGP 10. AGP 9 still accepts them under the new DSL, so this passes today and will start failing when the app moves to an RN release that pins AGP 10. android/build.gradle also has no namespace; the RN Gradle plugin fills it in from the manifest package. Both are follow-ups.


Note

Low Risk
Changes are limited to a new e2e fixture and CircleCI wiring; published SDK behavior is unchanged.

Overview
Adds AGP9TestApp, a minimal React Native 0.87 Android project (no JS) that autolinks react-native-purchases and react-native-purchases-ui from the monorepo—the first RN version that pins AGP 9. The app’s build.gradle applies the Kotlin Android plugin only when AGP has not already registered Kotlin, matching the guard from #1934.

CircleCI gains agp9_test_app_android, which runs :app:compileDebugKotlin twice: once with the stock template flags (android.builtInKotlin=false, android.newDsl=false) and once with built-in Kotlin and the new DSL enabled via -P, so CI covers both KGP and Expo-style AGP 9 setups. The job is on the default test workflow and is required by the release hold gate alongside core analyse/android/ios checks.

Reviewed by Cursor Bugbot for commit 24f5d1a. Bugbot is set up for automated code reviews on this repo. Configure here.

@AlvaroBrey AlvaroBrey added the pr:other A code change that improves performance label Sep 3, 2026
@AlvaroBrey AlvaroBrey self-assigned this Sep 3, 2026
@AlvaroBrey
AlvaroBrey marked this pull request as ready for review September 3, 2026 14:53
@AlvaroBrey
AlvaroBrey requested a review from a team as a code owner September 3, 2026 14:53
@AlvaroBrey
AlvaroBrey marked this pull request as draft September 3, 2026 14:54
@AlvaroBrey AlvaroBrey changed the title ci: smoke-test both Android modules under AGP 9 ci: build a React Native 0.87 app on AGP 9 with and without built-in Kotlin Sep 3, 2026
@RevenueCat-Danger-Bot

RevenueCat-Danger-Bot commented Sep 3, 2026

Copy link
Copy Markdown
1 Warning
⚠️ This PR increases the size of the repo by more than 100.00 KB (increased by 191.05 KB).

Generated by 🚫 Danger

@AlvaroBrey AlvaroBrey changed the title ci: build a React Native 0.87 app on AGP 9 with and without built-in Kotlin ci: compile a React Native 0.87 app on AGP 9 with and without built-in Kotlin Sep 3, 2026
@AlvaroBrey
AlvaroBrey marked this pull request as ready for review September 3, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:other A code change that improves performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants