react-native-2048 icon indicating copy to clipboard operation
react-native-2048 copied to clipboard

Problem in android

Open iChirag opened this issue 7 years ago • 10 comments

@liuhong1happy 0-neu-d1-a98a4b8b9e1733ee28f2a797119851c2 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.

iChirag avatar Jun 01 '17 11:06 iChirag

anyone can resolve?

iChirag avatar Jun 16 '17 05:06 iChirag

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

controversialUser avatar Sep 27 '17 13:09 controversialUser

Thank you for a solution. But It does not get resolved. :(

See this new error:

1513250535248

iChirag avatar Dec 14 '17 11:12 iChirag

@controversialUser @liuhong1happy please check this.

iChirag avatar Jan 16 '18 07:01 iChirag

@controversialUser do you have any other solution?

iChirag avatar May 21 '18 09:05 iChirag

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

controversialUser avatar Jun 19 '18 08:06 controversialUser

Will Check and revert you. Thanks

iChirag avatar Jun 20 '18 05:06 iChirag

@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.

iChirag avatar Jun 21 '18 14:06 iChirag

I've found this workaround: ReactViewGroup

bandojulio avatar Jun 22 '20 15:06 bandojulio

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.

thanh94r10 avatar Apr 09 '21 10:04 thanh94r10