[英]java.lang.ArrayIndexOutOfBoundsException in facebook.react.uimanager.ViewGroupDrawingOrderHelper.getChildDrawingOrder in React Native
Hi i am working in react native 0.61.4 and i got crashes in android not for iOS.嗨,我正在使用 React Native 0.61.4,我在 android 中遇到了崩溃,而不是 iOS。
java.lang.ArrayIndexOutOfBoundsException:facebook.react.uimanager.ViewGroupDrawingOrderHelper.getChildDrawingOrder(ViewGroupDrawingOrderHelper.java:98)
Android Crash only Android 仅崩溃
https://github.com/facebook/react-native/issues/27610
https://github.com/facebook/react-native/issues/27610
I have also created issue but nothing seem to helpful我也创建了问题,但似乎没有任何帮助
Can anybody tell me what is the actual error and how to fix this.谁能告诉我实际错误是什么以及如何解决这个问题。
thanks谢谢
I fixed it by understanding我通过理解修复了它
ViewGroupDrawingOrderHelper.java ViewGroupDrawingOrderHelper.java
The mistake i was doing that i was giving loader of zIndex 70
in style.我犯的错误是我在风格上给了
zIndex 70
加载器。
that's why app was crashing on android.这就是应用程序在 android 上崩溃的原因。 on iOS it was working fine.
在 iOS 上它运行良好。 and
和
by removing
zIndex 70.
from styles, my crash fixed ❤️通过从样式中删除
zIndex 70.
,我的崩溃修复了❤️
If you still want to keep the zIndex
, you can add the following to the FlatList
:如果您仍想保留
zIndex
,可以将以下内容添加到FlatList
:
removeClippedSubviews={false}
Credit to this comment on a react-native issue.感谢这个关于 react-native 问题的评论。
Not sure how this affects performance, seems like iOS has this as false
by default.不确定这对性能有何影响,似乎 iOS 默认将其设置为
false
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.