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. |
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