fix(android): pin react-android aarMetadata.minCompileSdk to 34#57289
Closed
cortinico wants to merge 1 commit into
Closed
fix(android): pin react-android aarMetadata.minCompileSdk to 34#57289cortinico wants to merge 1 commit into
cortinico wants to merge 1 commit into
Conversation
AGP 9 changed the default so a library propagates a minCompileSdk equal to its own compileSdk. Since react-android compiles against compileSdk 36, this now forces every consuming library/app to compileSdk >= 36 (e.g. it breaks libraries still on compileSdk 35 at checkAarMetadata). RN does not actually require API 36: its public ABI exposes no android type newer than ~API 23, the highest framework constant referenced in code is UPSIDE_DOWN_CAKE (34), and the source is deliberately written to compile against SDK 34 (see util/AndroidVersion.kt, which abstracts the 35/36 version codes and the API-35 windowOptOutEdgeToEdgeEnforcement attribute). compileSdk is 36 only to build against the latest platform. Set minCompileSdk = 34 explicitly to restore the pre-AGP-9 behavior and avoid needlessly forcing the library ecosystem onto compileSdk 36. The binary-compatibility-validator dump (ReactAndroid.api) guards against future regressions: adding an API 35/36 type to the public ABI would change that file and signal that this floor must rise.
|
@cortinico has imported this pull request. If you are a Meta employee, you can view this in D109154415. |
|
@cortinico merged this pull request in 29e5f95. |
1 task
leotm
added a commit
to leotm/react-native-template-new-architecture
that referenced
this pull request
Jul 17, 2026
…1971) - 0.87.0-nightly-20260519-58cd1bf58 to 0.87.0-nightly-20260705-e04ff69ab - Revert "Fix RN 0.83 iOS CI hermes-engine pod checksum drift" f8261a5 and resolve conflict - Bump CocoaPods incl React-Core-prebuilt and hermes-engine to 250829098.0.14 - Disable AGP 9 builtin Kotlin compiler and new DSL - fix: Failed to apply plugin 'org.jetbrains.kotlin.android' - Cannot add extension with name 'kotlin', as there is an extension already registered with that name - force AGP 9 to act like AGP 8 until libs migrated - add TODO to revert both flags and old KGP once ecosystem ready - ref: react/react-native#56222 - Enable AGP 9 R8 ProguardFile optimization - fix: `getDefaultProguardFile('proguard-android.txt')` is no longer supported since it includes `-dontoptimize`, which prevents R8 from performing many optimizations. Instead use `getDefaultProguardFile('proguard-android-optimize.txt)`, and if needed, temporarily use `-dontoptimize` in a custom keep rule file while fixing breakages. - improve: startup, memory, rendering and runtime perf, ANRs - Bump compileSdk and buildTools to 37 - Android 17 Beta, lvl 37, Cinnamon Bun - TODO: add upstream RN CI regression test for react/react-native#57284 (comment) i.e. -Pandroid.compileSdkVersion=36 - since react/react-native#57289 now -Pandroid.compileSdkVersion=34 - Update jest snapshot
leotm
added a commit
to leotm/react-native-template-new-architecture
that referenced
this pull request
Jul 17, 2026
…1971) - 0.87.0-nightly-20260519-58cd1bf58 to 0.87.0-nightly-20260705-e04ff69ab - Revert "Fix RN 0.83 iOS CI hermes-engine pod checksum drift" f8261a5 and resolve conflict - Bump CocoaPods incl React-Core-prebuilt and hermes-engine to 250829098.0.14 - Disable AGP 9 builtin Kotlin compiler and new DSL - fix: Failed to apply plugin 'org.jetbrains.kotlin.android' - cannot add extension with name 'kotlin', as there is an extension already registered with that name - force AGP 9 to act like AGP 8 until libs migrated - add TODO to revert both flags and old KGP once ecosystem ready - ref: react/react-native#56222 - Enable AGP 9 R8 ProguardFile optimization - fix: `getDefaultProguardFile('proguard-android.txt')` no longer supported since includes `-dontoptimize` preventing R8 optimizations - use `getDefaultProguardFile('proguard-android-optimize.txt)` or temp `-dontoptimize` in a custom keep rule file while fixing breakages - improve: startup, memory, rendering and runtime perf, ANRs - Bump compileSdk and buildTools to 37 - Android 17 Beta, lvl 37, Cinnamon Bun - TODO: add upstream RN CI regression test for react/react-native#57284 (comment) i.e. -Pandroid.compileSdkVersion=36 - since react/react-native#57289 now -Pandroid.compileSdkVersion=34 - Update jest snapshot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
AGP 9 changed the default so a library propagates a minCompileSdk equal to its own compileSdk. Since react-android compiles against compileSdk 36, this now forces every consuming library/app to compileSdk >= 36 (e.g. it breaks libraries still on compileSdk 35 at checkAarMetadata).
RN does not actually require API 36: its public ABI exposes no android type newer than ~API 23, the highest framework constant referenced in code is UPSIDE_DOWN_CAKE (34), and the source is deliberately written to compile against SDK 34 (see util/AndroidVersion.kt, which abstracts the 35/36 version codes and the API-35 windowOptOutEdgeToEdgeEnforcement attribute). compileSdk is 36 only to build against the latest platform.
Set minCompileSdk = 34 explicitly to restore the pre-AGP-9 behavior and avoid needlessly forcing the library ecosystem onto compileSdk 36. The binary-compatibility-validator dump (ReactAndroid.api) guards against future regressions: adding an API 35/36 type to the public ABI would change that file and signal that this floor must rise.
Changelog:
[ANDROID] [CHANGED] - Set minCompileSdk to 34, libraries will have to specify a compileSdk of >= 34 in order to work with React Native
Test Plan:
CI