question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android] Text missing on Android Q

See original GitHub issue

For an article page we render multiple paragraphs as Text components. Only some paragraphs don’t show the last line on Android Q. We couldn’t find any logic in which case the paragraph will fail to render everything.

React Native Environment Info: System: OS: macOS High Sierra 10.13.6 CPU: (12) x64 Intel® Core™ i7-8850H CPU @ 2.60GHz Memory: 3.45 GB / 32.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 10.13.0 - /usr/local/bin/node Yarn: 1.15.2 - /usr/local/bin/yarn npm: 6.4.1 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1 Android SDK: API Levels: 21, 23, 25, 26, 27, 28 Build Tools: 25.0.2, 27.0.3, 28.0.3 System Images: android-23 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom IDEs: Android Studio: 3.4 AI-183.6156.11.34.5522156 Xcode: 10.1/10B61 - /usr/bin/xcodebuild npmPackages: react: 16.8.3 => 16.8.3 react-native: 0.59.9 => 0.59.9 npmGlobalPackages: react-native-cli: 2.0.1 react-native-git-upgrade: 0.2.7

Steps To Reproduce

  1. react-native init androidBug
  2. Add script below to App.js
import {Platform, StyleSheet, Text, View, FlatList} from 'react-native';
import { LoremIpsum } from "lorem-ipsum";

const lorem = new LoremIpsum({
  sentencesPerParagraph: {
    max: 8,
    min: 4
  },
  wordsPerSentence: {
    max: 16,
    min: 4
  }
});

lorem.generateWords(1);
lorem.generateSentences(5);
lorem.generateParagraphs(7);

const instructions = Platform.select({
  ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
  android:
    'Double tap R on your keyboard to reload,\n' +
    'Shake or press menu button for dev menu',
});

type Props = {};
export default class App extends Component<Props> {
  render() {
    return (
      <View style={styles.container}>
        <FlatList
          data={[
            {key: lorem.generateParagraphs(7)},
            {key: lorem.generateParagraphs(7)},
            {key: lorem.generateParagraphs(7)},
            {key: lorem.generateParagraphs(7)},
            {key: lorem.generateParagraphs(7)},
            {key: lorem.generateParagraphs(7)},
            {key: lorem.generateParagraphs(7)},
            {key: lorem.generateParagraphs(7)},
            {key: lorem.generateParagraphs(7)},
            {key: lorem.generateParagraphs(7)},
            {key: lorem.generateParagraphs(7)},
            {key: lorem.generateParagraphs(7)},
            ]}
          renderItem={({item}) => {
            console.log(item.key);
           return <Text style={{marginBottom:50, fontSize:18}}>{item.key}</Text>}
          }
        />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
    marginBottom: 5,
  },
})
  1. open Pixel_2_XL_API_29 in emulator
  2. react-native run-android

I would expect to see all text rendered completely, but some are cut off at the end (see images).

Screen Shot 2019-06-13 at 17 06 39 Screen Shot 2019-06-13 at 15 43 01

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:8
  • Comments:16 (3 by maintainers)

github_iconTop GitHub Comments

10reactions
christianbachcommented, Oct 3, 2019

@enahum @tbress89 setting the textBreakStrategy prop for Text to simple solves the problem for us on Android 10

6reactions
tbress89commented, Aug 29, 2019

Same issue here, it seems to be related to the default textBreakStrategy of a TextView that changed from highQuality into simple since Android Q.

In this screenshot I have Pixel 3, API 28 (Android O) on the left and Pixel 3, API 29 (Android Q) on the right, same textual input. On the left the word “elektriciteitsfactuur” get’s split while on the right that’s not the case anymore, this causes an extra newline in the paragraph but the height measurement of the TextView seems to respond wrongly to this behaviour.

Picture 30

Read more comments on GitHub >

github_iconTop Results From Across the Web

Text Messages Disappeared from Android? Here're Solutions
Text Messages Disappeared? Here's How to Recover Deleted Text Messages on Android · 1. Restart Your Android Device · 2. Force Stop the...
Read more >
Fix problems sending, receiving or connecting to Messages
If you can't send or receive messages, or have trouble connecting to Messages on web, try the following suggestions below. Android Computer.
Read more >
How To Fix Not Receiving Text Messages On Android
Not receiving text messages on Android? 7 solutions to try ; 1. Check your network connections · 2. Disable Airplane Mode · Launch...
Read more >
6 Ways to Fix “Android Messaging App Not Working” Issue
1. Go over to settings. · 2. Tap the Applications. · 3. Choose All applications. · 4. Find the SMS app and then...
Read more >
Android Not Receiving Texts From IPhones? 8 Ways to Fix It
1. Start the Settings app. · 2. Tap Apps. · 3. Go to the list of apps (tap See all apps if necessary)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found