react-native: "SurfaceRegistryBinding::startSurface failed. Global was not installed". Getting this error on yarn android
Description
Upgrading my RN version from 0.67.3 to 0.76.7, first trying on getting the app running on android. After some amount of effort was able to get it to build but crashed immediately after its installed on the emulator. Tried reopening the app but still crashes.I have tried and all the cache clearing steps. Finally got this issue when i tried running from android studio and got this error from the Logcat. Might not be able to share the reproducer. Please help me out if this is any issue regarding my packages or any incompatibility issue.
Steps to reproduce
Install build with yarn android.
React Native Version
0.76.
Affected Platforms
Runtime - Android
Output of npx @react-native-community/cli info
System:
OS: macOS 15.3.1
CPU: (10) arm64 Apple M4
Memory: 147.08 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 18.20.6
path: ~/.nvm/versions/node/v18.20.6/bin/node
Yarn:
version: 1.22.22
path: /opt/homebrew/bin/yarn
npm:
version: 10.8.2
path: ~/.nvm/versions/node/v18.20.6/bin/npm
Watchman:
version: 2025.03.03.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods: Not Found
SDKs:
iOS SDK:
Platforms:
- DriverKit 24.2
- iOS 18.2
- macOS 15.2
- tvOS 18.2
- visionOS 2.2
- watchOS 11.2
Android SDK: Not Found
IDEs:
Android Studio: 2024.2 AI-242.23726.103.2422.12816248
Xcode:
version: 16.2/16C5032a
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.14
path: /usr/bin/javac
Ruby:
version: 2.7.4
path: /Users/donovanenas/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli":
installed: 15.0.1
wanted: 15.0.1
react:
installed: 18.3.1
wanted: 18.3.1
react-native:
installed: 0.76.7
wanted: 0.76.7
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: true
newArchEnabled: false
Stacktrace or Logs
No package ID 76 found for resource ID 0x760b000f.
No package ID 76 found for resource ID 0x760b000f.
ReactNativeJS com.appName TypeError: Cannot read property 'genericDirectEventTypes' of null
unknown:ReactNative com.appName Exception in native call java.lang.RuntimeException: SurfaceRegistryBinding::startSurface failed. Global was not installed.
at com.facebook.jni.NativeRunnable.run(Native Method) at android.os.Handler.handleCallback(Handler.java:959)
at android.os.Handler.dispatchMessage(Handler.java:100)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl.lambda$startNewBackgroundThread$2(MessageQueueThreadImpl.java:217)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$$ExternalSyntheticLambda1.run(D8$$SyntheticClass:0)
at java.lang.Thread.run(Thread.java:1012)
unknown:ReactHost com.appname Unhandled SoftException com.facebook.react.bridge.ReactNoCrashSoftException: raiseSoftException(getOrCreateDestroyTask()): handleHostException(message = "SurfaceRegistryBinding::startSurface failed. Global was not installed.")
at com.facebook.react.runtime.ReactHostImpl.raiseSoftException(ReactHostImpl.java:942)
at com.facebook.react.runtime.ReactHostImpl.getOrCreateDestroyTask(ReactHostImpl.java:1575)
at com.facebook.react.runtime.ReactHostImpl.lambda$destroy$7(ReactHostImpl.java:541)
at com.facebook.react.runtime.ReactHostImpl.$r8$lambda$uso21_D6dCZdcf-JomVD56kdG4c(Unknown Source:0)
at com.facebook.react.runtime.ReactHostImpl$$ExternalSyntheticLambda37.call(D8$$SyntheticClass:0)
at com.facebook.react.runtime.internal.bolts.Task$2.run(Task.java:240)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
Caused by: java.lang.RuntimeException: SurfaceRegistryBinding::startSurface failed. Global was not installed.
at com.facebook.jni.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:959)
at android.os.Handler.dispatchMessage(Handler.java:100)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl.lambda$startNewBackgroundThread$2(MessageQueueThreadImpl.java:217)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$$ExternalSyntheticLambda1.run(D8$$SyntheticClass:0)
at java.lang.Thread.run(Thread.java:1012)
unknown:ReactNative com.appname Exception in native call from JS
com.facebook.react.common.JavascriptException: TypeError: Cannot read property 'genericDirectEventTypes' of null, stack:
anonymous@402:5428
v@2:1473
d@2:945
o@2:413
anonymous@401:143
v@2:1473
d@2:945
o@2:413
anonymous@400:542
v@2:1473
d@2:945
o@2:413
anonymous@399:796
v@2:1473
d@2:945
o@2:413
anonymous@398:240
v@2:1473
d@2:945
o@2:413
anonymous@397:312
@2:1473
d@2:945
o@2:413
anonymous@396:119
v@2:1473
d@2:945
o@2:413
anonymous@6:57
v@2:1473
d@2:875
o@2:413
global@1571:3
at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.kt:52)
at com.facebook.jni.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:959)
at android.os.Handler.dispatchMessage(Handler.java:100)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl.lambda$startNewBackgroundThread$2(MessageQueueThreadImpl.java:217)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$$ExternalSyntheticLambda1.run(D8$$SyntheticClass:0)
at java.lang.Thread.run(Thread.java:1012)
unknown:ReactHost com.appname Unhandled SoftException
com.facebook.react.bridge.ReactNoCrashSoftException: raiseSoftException(getOrCreateDestroyTask()): handleHostException(message = "TypeError: Cannot read property 'genericDirectEventTypes' of null, stack:
anonymous@402:5428
v@2:1473
d@2:945
o@2:413
anonymous@401:143
v@2:1473
d@2:945
o@2:413
anonymous@400:542
v@2:1473
d@2:945
o@2:413
anonymous@399:796
v@2:1473
d@2:945
o@2:413
anonymous@398:240
v@2:1473
d@2:945
o@2:413
anonymous@397:312
v@2:1473
d@2:945
o@2:413
anonymous@396:119
v@2:1473
d@2:945
o@2:413
anonymous@6:57
v@2:1473
d@2:875
o@2:413
global@1571:3
")
at com.facebook.react.runtime.ReactHostImpl.raiseSoftException(ReactHostImpl.java:942)
at com.facebook.react.runtime.ReactHostImpl.getOrCreateDestroyTask(ReactHostImpl.java:1575)
at com.facebook.react.runtime.ReactHostImpl.lambda$destroy$7(ReactHostImpl.java:541)
at com.facebook.react.runtime.ReactHostImpl.$r8$lambda$uso21_D6dCZdcf-JomVD56kdG4c(Unknown Source:0)
at com.facebook.react.runtime.ReactHostImpl$$ExternalSyntheticLambda37.call(D8$$SyntheticClass:0)
at com.facebook.react.runtime.internal.bolts.Task$2.run(Task.java:240)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
Caused by: com.facebook.react.common.JavascriptException: TypeError: Cannot read property 'genericDirectEventTypes' of null, stack:
anonymous@402:5428
v@2:1473
d@2:945
o@2:413
anonymous@401:143
v@2:1473
d@2:945
o@2:413
anonymous@400:542
v@2:1473
d@2:945
o@2:413
anonymous@399:796
v@2:1473
d@2:945
o@2:413
anonymous@398:240
v@2:1473
d@2:945
o@2:413
anonymous@397:312
v@2:1473
d@2:945
o@2:413
anonymous@396:119
v@2:1473
d@2:945
o@2:413
anonymous@6:57
v@2:1473
d@2:875
o@2:413
global@1571:3
at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.kt:52)
at com.facebook.jni.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:959)
at android.os.Handler.dispatchMessage(Handler.java:100)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl.lambda$startNewBackgroundThread$2(MessageQueueThreadImpl.java:217)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$$ExternalSyntheticLambda1.run(D8$$SyntheticClass:0)
... 1 more
Reproducer
https://github.com/DonovanEnas/rn-upgrade-0.76-issue-android
Screenshots and Videos
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 25
On RN 0.79.2 still facing this issue
Issue appears on
v0.79.2with newArchThanks @migueldaipre For reference to everyone: https://github.com/expo/expo/issues/37407
Hey guys, this error is strictly related to the expo. Please create an issue there: https://github.com/expo/expo/issues
We feel free to reopen if the other repo points back to us as a issue in the core of React Native.
I am getting the same error using RN 0.79.2 anyone have solution for it?