software-mansion / react-native-reanimated

React Native's Animated library reimplemented
https://docs.swmansion.com/react-native-reanimated/
MIT License
9.04k stars 1.3k forks source link

App crash when I reload #4657

Closed thanhloc-17 closed 10 months ago

thanhloc-17 commented 1 year ago

Description

When I reload app, it's crash These log I see in Logcat (Android Studio)

 Cmdline: com.appname
  pid: 14263, tid: 14410, name: mqt_js  >>> com.appname <<<
#00 pc 00000000001dead8  /data/app/~~SLOyvYYoigdONevjLwd5uQ==/com.appname-fdMMlIoKuNrymFxS9KcN2w==/base.apk!libreanimated.so (BuildId: fa6182f6b06ba046f2a7e390d3fcc7a4460f1aa7)
#01 pc 00000000001dea20  /data/app/~~SLOyvYYoigdONevjLwd5uQ==/com.appname-fdMMlIoKuNrymFxS9KcN2w==/base.apk!libreanimated.so (BuildId: fa6182f6b06ba046f2a7e390d3fcc7a4460f1aa7)
#02 pc 00000000001de9a8  /data/app/~~SLOyvYYoigdONevjLwd5uQ==/com.appname-fdMMlIoKuNrymFxS9KcN2w==/base.apk!libreanimated.so (BuildId: fa6182f6b06ba046f2a7e390d3fcc7a4460f1aa7)
#03 pc 00000000001de63c  /data/app/~~SLOyvYYoigdONevjLwd5uQ==/com.appname-fdMMlIoKuNrymFxS9KcN2w==/base.apk!libreanimated.so (reanimated::PropsRegistry::pleaseSkipCommit()+44) (BuildId: fa6182f6b06ba046f2a7e390d3fcc7a4460f1aa7)
#04 pc 00000000001de0a8  /data/app/~~SLOyvYYoigdONevjLwd5uQ==/com.appname-fdMMlIoKuNrymFxS9KcN2w==/base.apk!libreanimated.so (reanimated::ReanimatedCommitHook::shadowTreeWillCommit(facebook::react::ShadowTree const&, std::__ndk1::shared_ptr<facebook::react::RootShadowNode const> const&, std::__ndk1::shared_ptr<facebook::react::RootShadowNode> const&) const+524) (BuildId: fa6182f6b06ba046f2a7e390d3fcc7a4460f1aa7)
#05 pc 0000000000079950  /data/app/~~SLOyvYYoigdONevjLwd5uQ==/com.appname-fdMMlIoKuNrymFxS9KcN2w==/base.apk!libreact_render_uimanager.so (facebook::react::UIManager::shadowTreeWillCommit(facebook::react::ShadowTree const&, std::__ndk1::shared_ptr<facebook::react::RootShadowNode const> const&, std::__ndk1::shared_ptr<facebook::react::RootShadowNode> const&) const+196) (BuildId: e397d8b720e0451e)

Steps to reproduce

  1. Turn on newArchEnabled
  2. Install the nightly version of reanimated
  3. build and test

Snack or a link to a repository

none

Reanimated version

3.4.0-nightly

React Native version

0.72.1

Platforms

Android

JavaScript runtime

None

Workflow

Expo bare workflow

Architecture

Fabric (New Architecture)

Build type

Debug mode

Device

Android emulator

Device model

No response

Acknowledgements

Yes

github-actions[bot] commented 1 year ago

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

tomekzaw commented 1 year ago

Hey @thanhloc-17, thanks for reporting this issue.

Right now we're aware of a few issues in Reanimated on the new architecture. However, none of them seems to match the stack trace you have provided. In particular, reanimated::PropsRegistry::pleaseSkipCommit only switches atomic boolean to true:

https://github.com/software-mansion/react-native-reanimated/blob/7143b1e049ba721b51ba570e2e22eb7f00672196/Common/cpp/Fabric/PropsRegistry.h#L40-L42

At this point I don't have any ideas on what could be wrong. Can you please provide a minimal repro so we can investigate the issue further?

victor-asdf commented 1 year ago

@thanhloc-17 I also got crashed when reload the application. If I rollback to react-native-reanimated v2 it is disappear.

billnbell commented 1 year ago

same here [facebook::react::UIManager::shadowTreeWillCommit]

chingmeng commented 1 year ago

same here [facebook::react::UIManager::shadowTreeWillCommit]

Facing this issue in iOS whenever hot reload trigger, with new arch and fabric enabled

Launch works, app operates normally, as soon as hot reload, hit ios Native Error below on Splash screen:

Screenshot 2023-08-07 at 12 53 38 PM

Attempt to turn off react-native-screens, and try again with hot reload, will hit this:

Screenshot 2023-08-07 at 12 58 02 PM

With react-native-screens turn off and upgrade react-native-gesture-handler from 2.5.0 to 2.12.1, I got this error:

Screenshot 2023-08-07 at 1 19 02 PM

If Splash screen (JS normal component, not native splash screen), comment out the navigation from 'react-navigation' seem fine and nothing happens, can reload normally without crashing.

Screenshot 2023-08-07 at 1 28 27 PM

Not sure if this related, https://github.com/facebook/react-native/pull/36216

billnbell commented 1 year ago

Yep that is the same issue I get. App crash with those same versions.