Commit 52fd654
Fix TextLayoutManager compilation against compile SDK 34 (facebook#56118)
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: D959940301 parent b1e2e5a commit 52fd654
2 files changed
Lines changed: 26 additions & 3 deletions
File tree
- packages/react-native/ReactAndroid/src/main/java/com/facebook/react
- util
- views/text
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
16 | 23 | | |
17 | 24 | | |
18 | 25 | | |
| |||
Lines changed: 19 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
108 | 121 | | |
109 | 122 | | |
110 | 123 | | |
| |||
623 | 636 | | |
624 | 637 | | |
625 | 638 | | |
626 | | - | |
| 639 | + | |
627 | 640 | | |
628 | 641 | | |
629 | 642 | | |
| |||
724 | 737 | | |
725 | 738 | | |
726 | 739 | | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
727 | 743 | | |
728 | | - | |
| 744 | + | |
729 | 745 | | |
730 | 746 | | |
731 | | - | |
| 747 | + | |
732 | 748 | | |
733 | 749 | | |
734 | 750 | | |
| |||
0 commit comments