Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React native app not running on android studio emulator

enter image description here

I was trying to run my ReactNative application on the Android Studio emulator - pixel . But , it's not working and gives the following error instead .

ERROR Error: Exception in HostObject::get for prop 'NativeUnimoduleProxy': java.lang.SecurityException: Permission Denial: registerScreenCaptureObserver from pid=9773, 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 was trying to run my app on the android studio emulator . It worked perfectly fine when run in VSCode and viewed in an external mobile device instead of using the android studio emulator .

like image 923
Chathura Abeygunawardhana Avatar asked May 15 '26 09:05

Chathura Abeygunawardhana


2 Answers

For me, the solution was to delete the previous emulator i had, using the "VanillaIceCream".

Delete the SDK, and then install a new simulator with api 34 ("UpSideDownCake"). The error went away after this.

enter image description here

like image 74
ivaldir Avatar answered May 16 '26 23:05

ivaldir


For me I was struggling with this for days, and then I just updated the Android API SDK to the latest version through Android Studio, and the problem was solved.

If you see update available instead of installed just uncheck and re-check again and hit apply enter image description here

like image 22
Anas Avatar answered May 16 '26 23:05

Anas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!