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

Error: Cannot find native module 'ExpoAsset', js engine: v8

Open Baart opened this issue 8 months ago • 1 comments

Hello,

Currently using v8 our expo app. When upgrading from sdk 50 to sdk 51, this issue arise at startup for real devices with Android <= 11 (works fine on IOS / Android > 11, and simulators) :

To reproduce, you can download minimum sample here : https://github.com/Baart/expo51-v8-android11/tree/main

Here are the logs :

Android Bundled 252ms index.js (572 modules) WARN No native ExponentConstants module found, are you sure the expo-constants's module is linked properly? ERROR Error: Cannot find native module 'ExpoAsset', js engine: v8 ERROR Invariant Violation: "main" has not been registered. This can happen if:

  • Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
  • A module failed to load due to an error and AppRegistry.registerComponent wasn't called., js engine: v8`

Sample app was created like this : npx create-expo-app -t bare-minimum@51 Follow v8 install https://github.com/Kudo/react-native-v8 npm run android

Image

Stack trace on logcat : W malloc(9223372036854775807) failed: returning null pointer

2025-05-19 16:16:02.740 7413-11112 ExpoModulesCore
E ❌ Cannot install JSI interop: java.lang.OutOfMemoryError: std::bad_alloc java.lang.OutOfMemoryError: std::bad_alloc at expo.modules.kotlin.jni.JSIContext.installJSI(Native Method) at expo.modules.kotlin.jni.JSIContext.installJSI(JSIContext.kt:40) at expo.modules.kotlin.AppContext.installJSIInterop(AppContext.kt:188) at expo.modules.kotlin.KotlinInteropModuleRegistry.installJSIInterop(KotlinInteropModuleRegistry.kt:96) at expo.modules.kotlin.ExpoBridgeModule.installModules(ExpoBridgeModule.kt:29) at com.facebook.jni.NativeRunnable.run(Native Method) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27) at android.os.Looper.loop(Looper.java:246) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:233) at java.lang.Thread.run(Thread.java:923)

W ⚠️ JSI interop was already installed I ✅ Constants were exported W No native ExponentConstants module found, are you sure the expo-constants's module is linked properly? E Error: Cannot find native module 'ExpoAsset', js engine: v8`

Let me know if this ring any bell for you Thank you :)

Baart avatar May 19 '25 14:05 Baart

same problem

chaimaeRegad avatar May 21 '25 12:05 chaimaeRegad