I noticed that my project had many npm security issues so, I decided to upgrade my expo sdk using npm install expo@latest
and npx expo install --fix
.
The security warnings were gone after this but I started having serious problem when I tried building the android app via Andriod Studio:
I used npx expo start
to start the development environment and selected option a for android build, unfortunately, it keeps failing with the following errors:
TypeError: Cannot read property 'packagerOpts' of null, js engine: hermes
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 started googing and I saw that I could use npx expo-doctor
to see what could be wrong. After running that line of code, I saw the following errors:
Error: Problems validating fields app.json
• Field: scheme - 'scheme' must match pattern "^[a-z][a-z0-9+.-]*$".
• Field: scheme - must be array.
• Field: scheme - must match exactly one schema in oneOf.
I have no experience in this and I can’t seem to find a solution online.
This is a react native app built with expo for sdk latest version.