-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
ReactSlider crash on Android release version #9979
Comments
Still crashes once in while in 0.40.0 |
I've been getting the same crash in AnimatorSet with a button created in a custom Android ViewManager, since at least 0.33. The crash is very rare relative to the number of times the view manager in question creates buttons, and happens in both release and debug on Android only. The line in question is:
(There is also an identical line in the shadow node which causes identical issues) I can pretty much guarantee the crash occurring by wrapping the line above in a loop. I didn't look into it deeply, but the nature of the problem and analysis of the code in AnimatorSet suggested it might be a threading issue. Sure enough, wrapping the line of code above in a block synchronized on something available to both the ViewManager and ShadowNode (e.g. the React context) eradicates the issue, although I assume the crash will still happen if code I don't have control over also creates / inflates Buttons concurrently with mine. The line has to be synchronized in both the ViewManager and the ShadowNode. Hopefully that narrows down the issue with the Slider and can help identify the root cause. |
+1 on this issue with ReactSlider on 0.40.0. Log below.
|
+1 RN 0.40.0
|
+1 RN0.39 also on Samsung devices! Any news on this? |
Still get the issue from time to time. Now I am on RN 0.41.2 |
We are also seeing this crash in production for example on a Galaxy S7 with Android 6.0 (RN 0.42.0)
|
+1 RN 0.43 |
+1 FN 0.43 |
+1 RN 0.43.4 Android 7.0
We're hiding the slider when the user clicks on "Finish". |
+1 |
+1 RN 0.43 |
+1 RN 0.37.0 |
+1 RN 0.44
|
Same here: 8 issues, all on Samsung devices, api level 23:
|
Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally! If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:
If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution. |
why closed? this crash is still not fix |
+1 RN 0.45.1
|
Still here for us also. Happened a few days ago on HUAWEI KIW-L21, OS Level 23 WITH "react-native": "0.48.2"
|
Same here:
|
Android 7.0 in production
|
@hramos still facing this on 0.47.2 on android production applications. Can you re open the issue as it is not yet fixed? |
Can confirm that I'm still seeing this issue RN 0.52 |
Confirm that bag exists on RN 0.54.4
|
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions. |
Android 7.0 in production |
I can confirm the issue using React-Native version 0.56.0 on Android 7.0 while running release build. |
+1 |
I m also facing the same problem, any one got this issue 's solution ? |
Same v0.56.1 |
Reproduced on 0.57.2 as well (Release Build) :( |
Reproduced on 0.55.2. I think that this is due to a race condition. In our situation we are moving to a next screen when you've set a value using the slider. This causes two things to happen at the same time: indicator/seek button becomes smaller with an animation, but the screen is also rerendering, thus removing the slider. My theory is that the slider is being removed and the animation is called after it, causing the NullPointerException. (It happens rarely though). Possible workaround could be:
Simulator used: Nexus 5X with Android 7.0 and 7.1 and device: API 24 (7.0), 520x960 hdpi |
Summary: This diff disables the StateListAnimator for the ReactSlider component in Android 6 and 7 This is this is a hack to prevent T37452851 and #9979 Reviewed By: yungsters Differential Revision: D13404685 fbshipit-source-id: d4c4f8796664c890f6a6b3502d3493370e17c300
Getting the same error. |
@ShaMan123 You can try one of the workarounds I provided. It seems like there is a workaround being provided by the React Native team as well, but you might want to wait for a stable release. We used https://github.com/jeanregisser/react-native-slider as a alternative. |
Summary: This diff disables the StateListAnimator for the ReactSlider component in Android 6 and 7 This is this is a hack to prevent T37452851 and facebook/react-native#9979 Reviewed By: yungsters Differential Revision: D13404685 fbshipit-source-id: d4c4f8796664c890f6a6b3502d3493370e17c300
This issue has been moved to callstack/react-native-slider#9. |
Android 7.0 in production Caused by: java.lang.NullPointerException Attempt to read from field 'android.animation.Animator android.animation.AnimatorSet$Node.mAnimation' on a null object reference
|
Reproduced in RN 0.57.8 |
Reproduced in RN 0.57.8 as well. I tried to use another Slider (https://github.com/jeanregisser/react-native-slider ) as @sjsikkema mentioned , and the problem was solved. It does work! |
Reproduced in RN 0.60.2 for Android devices with API versions 6, 7 and 7.1.1 |
For those experiencing the crash still, you can check out @newyankeecodeshop's workaround here: callstack/react-native-slider#9 (comment) |
Issue Description
Hard crash randomly and unexpectedly on Android release version only (debug is fine, iOS is fine on both debug and release) when hiding and displaying sliders based on a state variable.
Steps to Reproduce / Code Snippets
We have a number of photo filters in our app which are selected by
<TouchableOpacity>
components and some have a slider to adjust the blur or brightness etc. These sliders are completely separate from each other and are displayed based on a string stored in the components state calledfilter
.Here is one such slider from render():
{filter === 'gamify' && ( <View style={styles.filterSlider}> <Text>How retro do you want to go?</Text> <Slider value={this.state.pixelSize} minimumValue={1} maximumValue={5} onValueChange={value => this.setState({pixelSize: value})} /> </View>)}
Expected Results
No crash when hiding and displaying sliders
Stack Trace
java.lang.NullPointerException: Attempt to write to field 'java.util.ArrayList android.animation.AnimatorSet$Node.nodeDependents' on a null object reference
http://pastebin.com/270Wg6Pu
Additional Information
The text was updated successfully, but these errors were encountered: