expo / expo

An open-source framework for making universal native apps with React. Expo runs on Android, iOS, and the web.
https://docs.expo.dev
MIT License
32.82k stars 5.23k forks source link

SDK 39 Renanimated V2 android standalone apk crashing on load #10564

Closed Logan-Lim closed 3 years ago

Logan-Lim commented 3 years ago

🐛 Bug Report

Summary of Issue

When building an apk using Expo SDK 39 with the reanimated V2 Configuration, the standalone app will not open and crashes.

Edit(2020-10-08): This seems to be not specific to building the apk. But simply running the app in production mode (i.e. expo start --no-dev) should crash on load.

Environment - output of expo diagnostics & the platform(s) you're targeting

OS: Windows

Expo CLI 3.27.13 environment info: System: Binaries: Node: 12.14.1 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 6.13.4 - C:\Program Files\nodejs\npm.CMD IDEs: Android Studio: Version 4.0.0.0 AI-193.6911.18.40.6626763 npmPackages: expo: ~39.0.0 => 39.0.3 react: ~16.13.0 => 16.13.1 react-dom: ~16.13.0 => 16.13.1 react-native: https://github.com/expo/react-native/archive/sdk-39.0.2.tar.gz => 0.63.2 react-native-web: 0.13.13 => 0.13.13 Expo Workflow: managed

Reproducible Demo

I initially found this when trying to migrate my own project, but the same issue is reproduceable in the 'with-reanimated2' create react native app template. Note this works fine running locally off an expo start.

Note: I am not able to test if this works on iOS.

Steps to Reproduce

1) run npx create-react-native-app --template with-reanimated2 2) expo build:android 3) install .apk on emulator/phone 4) open app

Expected Behavior vs Actual Behavior

The app crashes while opening. And I got the following from an 'adb logcat *:E' on my emulator.

10-05 15:21:08.680 27460 27460 E AndroidRuntime: FATAL EXCEPTION: main
10-05 15:21:08.680 27460 27460 E AndroidRuntime: Process: com.loganlim.testReanimatedV2, PID: 27460
10-05 15:21:08.680 27460 27460 E AndroidRuntime: java.lang.RuntimeException: Expo encountered a fatal error: Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'NativeReanimated' could not be found. Verify that a module by this name is registered in the native binary., stack:
10-05 15:21:08.680 27460 27460 E AndroidRuntime: exports@23:286
10-05 15:21:08.680 27460 27460 E AndroidRuntime: getEnforcing@27:169
10-05 15:21:08.680 27460 27460 E AndroidRuntime: <unknown>@747:222
10-05 15:21:08.680 27460 27460 E AndroidRuntime: v@2:1473
10-05 15:21:08.680 27460 27460 E AndroidRuntime: <unknown>@746:156
10-05 15:21:08.680 27460 27460 E AndroidRuntime: v@2:1473
10-05 15:21:08.680 27460 27460 E AndroidRuntime: <unknown>@741:5441
10-05 15:21:08.680 27460 27460 E AndroidRuntime: v@2:1473
10-05 15:21:08.680 27460 27460 E AndroidRuntime: <unkno
10-05 15:21:08.680 27460 27460 E AndroidRuntime:        at host.exp.exponent.experience.q.F(BaseExperienceActivity.java:7)
10-05 15:21:08.680 27460 27460 E AndroidRuntime:        at host.exp.exponent.experience.a.run(Unknown Source:2)
10-05 15:21:08.680 27460 27460 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:907)
10-05 15:21:08.680 27460 27460 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:99)
10-05 15:21:08.680 27460 27460 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:223)
10-05 15:21:08.680 27460 27460 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:7478)
10-05 15:21:08.680 27460 27460 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
10-05 15:21:08.680 27460 27460 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:549)
10-05 15:21:08.680 27460 27460 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)
10-05 15:21:08.788   559   642 E InputDispatcher: channel '7198952 com.loganlim.testReanimatedV2/host.exp.exponent.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
10-05 15:21:08.793   559  1825 E SurfaceControl: Call to SurfaceControl.closeTransaction without matching openTransaction
gaishimo commented 3 years ago

I also am experiencing the same issue on Android device.

Environments

logs ``` 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: CatalystInstanceImpl caught native exception 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: com.facebook.react.common.JavascriptException: Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'NativeReanimated' could not be found. Verify that a module by this name is registered in the native binary., stack: 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: exports@23:286 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: getEnforcing@27:169 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: @1378:222 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: v@2:1473 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: @1377:156 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: v@2:1473 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: @1373:5194 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: v@2:1473 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: @1334:1632 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: v@2:1473 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: @1333:1946 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: v@2:1473 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: @1332:3619 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: v@2:1473 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: @898:1324 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: v@2:1473 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: @744:846 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: v@2:1473 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: @726:1450 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: v@2:1473 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: @722:138 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: v@2:1473 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: @6:66 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: v@2:1473 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: d@2:875 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: global code@1508:3 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:12) 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: at java.lang.reflect.Method.invoke(Native Method) 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:18) 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:2) 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: at android.os.Handler.handleCallback(Handler.java:883) 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: at android.os.Handler.dispatchMessage(Handler.java:100) 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:1) 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: at android.os.Looper.loop(Looper.java:214) 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:8) 10-06 07:49:24.513 6272 6391 E unknown:ReactNative: at java.lang.Thread.run(Thread.java:919) 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: Caught exception 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: com.facebook.react.common.JavascriptException: Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'NativeReanimated' could not be found. Verify that a module by this name is registered in the native binary., stack: 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: exports@23:286 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: getEnforcing@27:169 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: @1378:222 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: v@2:1473 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: @1377:156 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: v@2:1473 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: @1373:5194 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: v@2:1473 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: @1334:1632 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: v@2:1473 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: @1333:1946 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: v@2:1473 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: @1332:3619 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: v@2:1473 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: @898:1324 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: v@2:1473 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: @744:846 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: v@2:1473 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: @726:1450 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: v@2:1473 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: @722:138 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: v@2:1473 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: @6:66 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: v@2:1473 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: d@2:875 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: global code@1508:3 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:12) 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: at java.lang.reflect.Method.invoke(Native Method) 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:18) 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:2) 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: at android.os.Handler.handleCallback(Handler.java:883) 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: at android.os.Handler.dispatchMessage(Handler.java:100) 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:1) 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: at android.os.Looper.loop(Looper.java:214) 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:8) 10-06 07:49:24.513 6272 6391 E unknown:DisabledDevSupportManager: at java.lang.Thread.run(Thread.java:919) 10-06 07:49:24.514 6272 6272 D AndroidRuntime: Shutting down VM 10-06 07:49:24.514 6272 6272 E AndroidRuntime: FATAL EXCEPTION: main 10-06 07:49:24.514 6272 6272 E AndroidRuntime: Process: app.omoidasu.tadayou_dev, PID: 6272 10-06 07:49:24.514 6272 6272 E AndroidRuntime: java.lang.RuntimeException: Expo encountered a fatal error: Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'NativeReanimated' could not be found. Verify that a module by this name is registered in the native binary., stack: 10-06 07:49:24.514 6272 6272 E AndroidRuntime: exports@23:286 10-06 07:49:24.514 6272 6272 E AndroidRuntime: getEnforcing@27:169 10-06 07:49:24.514 6272 6272 E AndroidRuntime: @1378:222 10-06 07:49:24.514 6272 6272 E AndroidRuntime: v@2:1473 10-06 07:49:24.514 6272 6272 E AndroidRuntime: @1377:156 10-06 07:49:24.514 6272 6272 E AndroidRuntime: v@2:1473 10-06 07:49:24.514 6272 6272 E AndroidRuntime: @1373:5194 10-06 07:49:24.514 6272 6272 E AndroidRuntime: v@2:1473 10-06 07:49:24.514 6272 6272 E AndroidRuntime:
brentvatne commented 3 years ago

hi, we'll look into this

Svarto commented 3 years ago

Same here!

kmagiera commented 3 years ago

@Szymon20000 any ideas on this one?

Logan-Lim commented 3 years ago

I'm actually able to reproduce this while running locally if I enable production mode.

Expo logs the following error in console (same as reported before): Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'NativeReanimated' could not be found. Verify that a module by this name is registered in the native binary.

Arturszott commented 3 years ago

Hey! I noticed that for local development clearing cache with expo start -c flag is enough to get rid of this bug.

The problem still exists for me if I want to publish on the release-channel.

Already tried:

rm -rf $TMPDIR/metro* && expo publish --clear --release-channel my-channel

but results are the same as above.

devozs commented 3 years ago

same here, it works well while using expo start and opening android emulator. however in case of running it using expo publish or expo build:android it is failing, Logcat:

NativeReanimated' could not be found. Verify that a module by this name is registered in the native binary

Please note that installing and running the apk (generated via expo build:android) produce the same error for both physical device or emulator (in compare to expo start+ a that is working fine)

brentvatne commented 3 years ago

we'll hopefully have an answer for next week, thanks for the info.

Logan-Lim commented 3 years ago

@brentvatne any updates on this one? I really like Reanimated v2 so far, but depending on timeline might have to revert.

brentvatne commented 3 years ago

@Logan-Lim - no update at the moment, sorry for the delays. i'll try to find someone to investigate this next week.

leonelunderscore commented 3 years ago

@brentvatne any updates on this one? I really like Reanimated v2 so far, but depending on the timeline might have to revert.

Me too I am waiting for the solution to this to publish my app

sjchmiela commented 3 years ago

Bug found and fixed. 🕵️ The change is being applied to SDK39 Android workers, you may expect it to land in the next 12 hours. 🔜

sjchmiela commented 3 years ago

Bugfix pushed to builders! All builds triggered after Monday, October 26 2020, 18:17 2020 UTC should get the new native backing code allowing you to use Reanimated v2 in standalone apps.

Fix has not been published in a new release of Expo client, so running apps in production mode there will still give you an error.

exseniorastronaut commented 3 years ago

I am experiencing the exact same error when making an apk using managed workflow SDK 40. Works fine in development using expo client. @sjchmiela

outaTiME commented 3 years ago

like here I am still experiencing random problems in some android devices using managed workflow with the SDK40 (removing the experimental flag of turbomodules improved stability) but my users are experiencing unexpected closings, I leave a screenshot.

I am trying to identify the case but locally and with my android devices I have not been able to reproduce it, the following error is the one that generates all the errors:

<un: 
  at host.exp.exponent.experience.BaseExperienceActivity.lambda$consumeErrorQueue$0 (BaseExperienceActivity.java:210)
  at host.exp.exponent.experience.-$$Lambda$BaseExperienceActivity$zZZNiLUhJmY4AlwF2loJATXcbqc.run (-.java:2)
  at android.os.Handler.handleCallback (Handler.java:873)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loop (Looper.java:193)
  at android.app.ActivityThread.main (ActivityThread.java:6863)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:537)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:858)
image

An here more details about the devices:

image

I forgot, as the expo sdk40 reanimated paper says I'm using react-native-reanimated@2.0.0-rc.0.

ivansenic commented 3 years ago

@outaTiME @Tiltorito I am getting the same as you guys with Expo SDK v40 and native-reanimated rc0. On my android phone it's clearly reproducible in Alpha testing, but not on the Expo client (even in the production mode). Can somebody create a new ticket that will reference this new issue in the latest SDK?

Here'sthe stacktrace from the app crash preview.

unnamed

ivansenic commented 3 years ago

@sjchmiela Can you have a look on the latest comments regarding this issue reoccurring in the SDK v40? Thanks...

exseniorastronaut commented 3 years ago

@ivansenic @outaTiME I created a new issue: #11529 - It would be nice if you could upload your crash reports in the new issue so its easier to track