react-native-2048
react-native-2048 copied to clipboard
Problem in android
@liuhong1happy
can you try to run 2048 in Android, it cause crashed after 5-10 moves of tiles.
It also crash application on Android if you try to moves quickly one after one.
However it working perfect on iPhone.
anyone can resolve?
well in android this problem is made from animations ... comment this piece of code :
UIManager.setLayoutAnimationEnabledExperimental &&
UIManager.setLayoutAnimationEnabledExperimental(true)
in common/components/container.js componentWillMount() and the game will work ok but without animations
Thank you for a solution. But It does not get resolved. :(
See this new error:
@controversialUser @liuhong1happy please check this.
@controversialUser do you have any other solution?
Hello @iChirag , sorry for the late response.This is my final code , can you check it out
https://drive.google.com/open?id=1eowv_hHONF9yYp7supuEkTOJjPpecUUp
import it in your project
import ReactNative2048 from './2048';
than use it in render like this
<ReactNative2048 />
hope it helps
Will Check and revert you. Thanks
@controversialUser Your code almost similar to remove below code in existing code.
UIManager.setLayoutAnimationEnabledExperimental && UIManager.setLayoutAnimationEnabledExperimental(true)
It still results same and crashing in android.
I've found this workaround: ReactViewGroup
I replaced
LayoutAnimation.easeInEaseOut();
by
LayoutAnimation.configureNext({ duration: 300, create: { type: LayoutAnimation.Types.easeInEaseOut, property: LayoutAnimation.Properties.opacity, }, update: { type: LayoutAnimation.Types.easeInEaseOut, } });
This works on both Android and iOS without any crashes.