Skip to content

Fix TextLayoutManager compilation against compile SDK 34 (#56118)#56118

Open
azverkan wants to merge 1 commit intofacebook:mainfrom
azverkan:export-D95994030
Open

Fix TextLayoutManager compilation against compile SDK 34 (#56118)#56118
azverkan wants to merge 1 commit intofacebook:mainfrom
azverkan:export-D95994030

Conversation

@azverkan
Copy link

@azverkan azverkan commented Mar 16, 2026

Summary:

TextLayoutManager.kt references Android 15 (API 35) symbols
(Build.VERSION_CODES.VANILLA_ICE_CREAM and
StaticLayout.Builder.setUseBoundsForWidth) that are unavailable when
compiling against SDK level 34. This causes build failures for any
Android target using compile_sdk_version = 34.

Fix by defining VERSION_CODE_VANILLA_ICE_CREAM = 35 in
AndroidVersion.kt (following the existing VERSION_CODE_BAKLAVA
pattern) and using reflection for setUseBoundsForWidth. Runtime
behavior is unchanged — the version check guards ensure these code
paths only execute on Android 15+ devices.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D95994030

@meta-codesync
Copy link

meta-codesync bot commented Mar 16, 2026

@azverkan has exported this pull request. If you are a Meta employee, you can view the originating Diff in D95994030.

@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 Mar 16, 2026
Copy link
Contributor

@cortinico cortinico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@meta-codesync meta-codesync bot changed the title Fix TextLayoutManager compilation against compile SDK 34 Fix TextLayoutManager compilation against compile SDK 34 (#56118) Mar 18, 2026
azverkan added a commit to azverkan/react-native that referenced this pull request Mar 18, 2026
)

Summary:

TextLayoutManager.kt references Android 15 (API 35) symbols
(`Build.VERSION_CODES.VANILLA_ICE_CREAM` and
`StaticLayout.Builder.setUseBoundsForWidth`) that are unavailable when
compiling against SDK level 34. This causes build failures for any
Android target using `compile_sdk_version = 34`.

Fix by defining `VERSION_CODE_VANILLA_ICE_CREAM = 35` in
`AndroidVersion.kt` (following the existing `VERSION_CODE_BAKLAVA`
pattern) and using reflection for `setUseBoundsForWidth`. Runtime
behavior is unchanged — the version check guards ensure these code
paths only execute on Android 15+ devices.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D95994030
azverkan added a commit to azverkan/react-native that referenced this pull request Mar 18, 2026
)

Summary:
Pull Request resolved: facebook#56118

TextLayoutManager.kt references Android 15 (API 35) symbols
(`Build.VERSION_CODES.VANILLA_ICE_CREAM` and
`StaticLayout.Builder.setUseBoundsForWidth`) that are unavailable when
compiling against SDK level 34. This causes build failures for any
Android target using `compile_sdk_version = 34`.

Fix by defining `VERSION_CODE_VANILLA_ICE_CREAM = 35` in
`AndroidVersion.kt` (following the existing `VERSION_CODE_BAKLAVA`
pattern) and using reflection for `setUseBoundsForWidth`. Runtime
behavior is unchanged — the version check guards ensure these code
paths only execute on Android 15+ devices.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D95994030
)

Summary:
Pull Request resolved: facebook#56118

TextLayoutManager.kt references Android 15 (API 35) symbols
(`Build.VERSION_CODES.VANILLA_ICE_CREAM` and
`StaticLayout.Builder.setUseBoundsForWidth`) that are unavailable when
compiling against SDK level 34. This causes build failures for any
Android target using `compile_sdk_version = 34`.

Fix by defining `VERSION_CODE_VANILLA_ICE_CREAM = 35` in
`AndroidVersion.kt` (following the existing `VERSION_CODE_BAKLAVA`
pattern) and using reflection for `setUseBoundsForWidth`. Runtime
behavior is unchanged — the version check guards ensure these code
paths only execute on Android 15+ devices.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D95994030
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. fb-exported meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants