Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Expo-Router Template throwing error when running npm run Android

I've just created an Expo Project with the following command:

npx create-expo-app@latest --template tabs@50

I have everything I need installed (I think?): Android Studio, Xcode, etc. When running npm start android, the emulator opens and then crashes with this error:

 ERROR  Error: Exception in HostObject::get for prop 'NativeUnimoduleProxy': java.lang.SecurityException: Permission Denial: registerScreenCaptureObserver from pid=2093, uid=10182 requires android.permission.DETECT_SCREEN_CAPTURE, js engine: hermes
 ERROR  Error: Exception in HostObject::get for prop 'NativeUnimoduleProxy': java.lang.SecurityException: Permission Denial: registerScreenCaptureObserver from pid=2093, uid=10182 requires android.permission.DETECT_SCREEN_CAPTURE, js engine: hermes
 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: hermes

I have not modified anything in the project. What does this error mean?

I tried just creating the project with the template (from expo docs). Expected the app to open in Android Emulator, but it crashes.

like image 869
demodogo Avatar asked Nov 01 '25 19:11

demodogo


1 Answers

If you´re experiencing this error with expo go, your emulator Android System Image is probably "too new". For me "VanillaIceCream" API level wasn't working. Others reported on the expo discord, that "UpsideDownCakePrivacySandbox" wasn't working either. I took "UpsideDownCake" / API Level 34 which worked for me. According to official expo docs "Tiramisu" also works. I did not try "TiramisuPrivacySandbox". Here is a screenshot of Android Studio Device Manager enter image description here

like image 179
tomwaitforitmy Avatar answered Nov 04 '25 15:11

tomwaitforitmy