Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android crash with length=15; index=-6 #22816

Closed
luutruong opened this issue Dec 28, 2018 · 8 comments
Closed

Android crash with length=15; index=-6 #22816

luutruong opened this issue Dec 28, 2018 · 8 comments
Labels
Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.

Comments

@luutruong
Copy link

I have faced this issues in android

Environment

React Native Environment Info:
    System:
      OS: macOS 10.14.2
      CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
      Memory: 33.66 MB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.10.0 - /usr/local/bin/node
      npm: 6.5.0 - /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: 23, 25, 26, 27
        Build Tools: 27.0.3, 28.0.3
        System Images: android-28 | Google APIs Intel x86 Atom
    IDEs:
      Android Studio: 3.2 AI-181.5540.7.32.5056338
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.6.3 => 16.6.3
      react-native: 0.57.8 => 0.57.8
    npmGlobalPackages:
      react-native-cli: 2.0.1
      react-native-rename: 2.3.2

Description

length=15; index=-6
getLineTop
    StaticLayout.java:1208
onMeasure
    TextView.java:8629
measure
    View.java:23169
updateLayout
    NativeViewHierarchyManager.java:176
execute
    UIViewOperationQueue.java:175
run
    UIViewOperationQueue.java:894
flushPendingBatches
    UIViewOperationQueue.java:1001
access$2400
    UIViewOperationQueue.java:46
doFrameGuarded
    UIViewOperationQueue.java:1061
doFrame
    GuardedFrameCallback.java:29
doFrame
    ReactChoreographer.java:134
doFrame
    ChoreographerCompat.java:105
run
    Choreographer.java:947
doCallbacks
    Choreographer.java:761
doFrame
    Choreographer.java:693
run
    Choreographer.java:935
handleCallback
    Handler.java:873
dispatchMessage
    Handler.java:99
loop
    Looper.java:193
main
    ActivityThread.java:6669
invoke
    Method.java
run
    RuntimeInit.java:493
main
    ZygoteInit.java:858

Reproducible Demo

@react-native-bot react-native-bot added the Platform: Android Android applications. label Dec 28, 2018
@noahtallen
Copy link

Can you provide a reproducible demo as well as more information about when you experience this issue?

@luutruong
Copy link
Author

@noahtallen It's private project so cannot give an demo for yet. The problem is happen whenever I open the app.

This is my package.json

"dependencies": {
    "axios": "^0.18.0",
    "crypto-js": "^3.1.9-1",
    "immutable": "^4.0.0-rc.12",
    "querystring": "^0.2.0",
    "react": "16.6.3",
    "react-native": "0.57.8",
    "react-native-actionsheet": "^2.4.2",
    "react-native-device-info": "^0.24.3",
    "react-native-fast-image": "^5.1.1",
    "react-native-fbsdk": "^0.8.0",
    "react-native-gesture-handler": "^1.0.12",
    "react-native-i18n": "^2.0.15",
    "react-native-image-crop-picker": "^0.21.3",
    "react-native-onesignal": "^3.2.12",
    "react-native-render-html": "^3.10.0",
    "react-native-vector-icons": "^6.1.0",
    "react-navigation": "^3.0.8"
  },

@noahtallen
Copy link

The error usually occurs when an array index is out of bounds - in your case, the array length is 15, but it is trying to access index -6. Is there anything in your code which would point to that being an issue? The crash logs indicate it has to do with the Text component.

@luutruong
Copy link
Author

Thank you @noahtallen for explain. After debug my code and I have found the issues.

<Text numberOfLines ={-1}>A long text here....</Text>

That crash on android but IOS did not.

Does it is bug?

@noahtallen
Copy link

Why would you set it to -1? You can’t have less than 0 things displayed at once :p

@luutruong
Copy link
Author

My idea is want to render unlimited of text lines. That config maybe invalid i guess the core should throw if provide out of range?

@noahtallen
Copy link

noahtallen commented Dec 30, 2018 via email

@rickhanlonii
Copy link
Member

Hey @luutruong, thanks for filing

This looks like a question and not a bug. Since this issue tracker is not a help forum, we're going to close and recommend posting to StackOverflow. If you believe this is a bug, please update the provide a way for us to reproduce/confirm and we'll consider re-opening 👌

@facebook facebook locked as resolved and limited conversation to collaborators Dec 31, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Dec 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants