In your post, please share:
- Whether you are bare or managed workflow
- What you have tried so far
Google searching and looking at similar posts on this forum.
I am working in a monorepo and I’m getting this error
Invariant Violation: "main" has not been registered. when I run the locally built apk in Android Studio.
We have an index.js file in a nested apps/expo folder
import App from './App'; // registerRootComponent calls AppRegistry.registerComponent('main', () => App); // It also ensures that whether you load the app in Expo Go or in a native build, // the environment is set up appropriately registerRootComponent(App);
One thing I noticed is that this file is hoisted to the root directory for some reason. Is that the reason for this error? Why does this happen and how can I prevent it? I had to create an App.js file in the root level that imported the App.tsx file in the expo directory for the build to even run.
Any help would be greatly appreciated!