
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.registerComponentwasn'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 .
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.

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

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