Skip to content

[Android Experimental] [Android 15/16] multi-line text isn't displayed #56185

Description

@atlj

Description

On Android 15 and Android 16, if you enable the Experimental mode, only the first line of a multi-line text is displayed.

Steps to reproduce

  1. Enable the experimental release level on Android:
    DefaultNewArchitectureEntryPoint.releaseLevel = ReleaseLevel.EXPERIMENTAL
  2. Put a multi-line text on the app
  3. Build and run the app

React Native Version

0.84.1

Affected Platforms

Runtime - Android

Output of npx @react-native-community/cli info

info Fetching system and libraries information...
System:
  OS: macOS 15.7.4
  CPU: (12) arm64 Apple M4 Pro
  Memory: 294.92 MB / 48.00 GB
  Shell:
    version: 0.109.1
    path: /Users/burakguner/.cargo/bin/nu
Binaries:
  Node:
    version: 22.22.0
    path: /Users/burakguner/.nix-profile/bin/node
  Yarn:
    version: 1.22.22
    path: /Users/burakguner/.nix-profile/bin/yarn
  npm:
    version: 10.9.4
    path: /Users/burakguner/.nix-profile/bin/npm
  Watchman:
    version: 2026.01.19.00
    path: /Users/burakguner/.nix-profile/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /Users/burakguner/.local/share/gem/ruby/3.3.0/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.2
      - iOS 26.2
      - macOS 26.2
      - tvOS 26.2
      - visionOS 26.2
      - watchOS 26.2
  Android SDK:
    API Levels:
      - "30"
      - "34"
      - "35"
      - "36"
    Build Tools:
      - 35.0.0
      - 36.0.0
      - 36.1.0
    System Images:
      - android-30 | ARM 64 v8a
      - android-34 | Google Play ARM 64 v8a
      - android-35 | Google APIs ARM 64 v8a
      - android-35 | Google Play ARM 64 v8a
      - android-36.1 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2025.3 AI-253.30387.90.2532.14935130
  Xcode:
    version: 26.2/17C52
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 21.0.8
    path: /Users/burakguner/.nix-profile/bin/javac
  Ruby:
    version: 3.4.8
    path: /Users/burakguner/.nix-profile/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.1.0
    wanted: 20.1.0
  react:
    installed: 19.2.3
    wanted: 19.2.3
  react-native:
    installed: 0.84.1
    wanted: 0.84.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: false

Stacktrace or Logs

<none>

MANDATORY Reproducer

https://github.com/atlj/reproducer-rn-text-not-breaking

Screenshots and Videos

Android 14 Android 15 Android 16
Image Image Image

Activity

  1. xrustics commented on Mar 26, 2026

    @xrustics

    Same problem, but we don't use DefaultNewArchitectureEntryPoint.releaseLevel = ReleaseLevel.EXPERIMENTAL

  2. DimitarNestorov commented on Mar 26, 2026

    @DimitarNestorov
    Contributor

    Same problem, but we don't use DefaultNewArchitectureEntryPoint.releaseLevel = ReleaseLevel.EXPERIMENTAL

    Which version of React Native are you using?

  3. xrustics commented on Mar 27, 2026

    @xrustics

    Same problem, but we don't use DefaultNewArchitectureEntryPoint.releaseLevel = ReleaseLevel.EXPERIMENTAL

    Which version of React Native are you using?

    We use react native 0.84.1

  4. DimitarNestorov commented on Mar 27, 2026

    @DimitarNestorov
    Contributor

    Which version of React Native are you using?

    We use react native 0.84.1

    @xrustics and you're getting this on Android 15 and 16 only? No issues on Android 14?

  5. xrustics commented on Mar 30, 2026

    @xrustics

    Which version of React Native are you using?

    We use react native 0.84.1

    @xrustics and you're getting this on Android 15 and 16 only? No issues on Android 14?

    We hit the same issue on Android 15+ only (RN 0.84.1, New Architecture/Fabric): multiline text rendered only the first line (both in custom components and plain Text), while iOS was fine.

    For us, the root cause was in ReactAndroid TextLayoutManager width calculation in the Android 15+ visual-bounds path.
    This temporary workaround fixed it:

    1) Patch TextLayoutManager.kt

    Replace:

    val lineWidth = unconstrainedLayout.getLineRight(i) - unconstrainedLayout.getLineLeft(i)
    ...
    when (widthYogaMeasureMode) {
      YogaMeasureMode.AT_MOST -> min(ceil(desiredVisualWidth).toInt(), floor(width).toInt())
      else -> ceil(desiredVisualWidth).toInt()
    }

    With:

    val lineWidth = unconstrainedLayout.getLineMax(i)
    ...
    when (widthYogaMeasureMode) {
      YogaMeasureMode.EXACTLY -> floor(width).toInt()
      YogaMeasureMode.AT_MOST -> min(ceil(desiredVisualWidth).toInt(), floor(width).toInt())
      else -> ceil(desiredVisualWidth).toInt()
    }

    2) Apply patch automatically after install

    We added a postinstall script:

    "postinstall": "node scripts/apply-react-native-text-layout-patch.mjs"

    3) Rebuild/publish patched react-android and include all ABIs

    cd android
    ./gradlew :react-native:packages:react-native:ReactAndroid:publishReleasePublicationToMavenTempLocalRepository \
      -PreactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64

    4) Point app build to local Maven with patched artifacts

    In android/gradle.properties:

    reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
    react.internal.mavenLocalRepo=/tmp/maven-local

    After this, multiline wrapping was restored globally for us (plain Text) and assembleDebug passed without ABI mismatch errors.

    Notes

    • /tmp/maven-local is temporary; if it is cleaned, republish artifacts.
    • This is a workaround until an upstream RN fix is available.

    I hope this helps someone 🙏

  6. josemariaeliasMM commented on Apr 9, 2026

    @josemariaeliasMM

    Is the fix gonna be released into 0.85.1 ? I have the same issue the 2nd line is not rendered on Android, iOS is working fine

    I just realized I got my app using the Experimental Release Level, so I would get back to the Stable track

    EDIT:
    Going back to the Stable track did the job!

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions