Skip to content

fix(android): pin react-android aarMetadata.minCompileSdk to 34#57289

Closed
cortinico wants to merge 1 commit into
mainfrom
nc/minCompileSdk
Closed

fix(android): pin react-android aarMetadata.minCompileSdk to 34#57289
cortinico wants to merge 1 commit into
mainfrom
nc/minCompileSdk

Conversation

@cortinico

Copy link
Copy Markdown
Contributor

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

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.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 19, 2026
@meta-codesync

meta-codesync Bot commented Jun 19, 2026

Copy link
Copy Markdown

@cortinico has imported this pull request. If you are a Meta employee, you can view this in D109154415.

@meta-codesync meta-codesync Bot closed this in 29e5f95 Jun 19, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Jun 19, 2026
@meta-codesync

meta-codesync Bot commented Jun 19, 2026

Copy link
Copy Markdown

@cortinico merged this pull request in 29e5f95.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant