You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Invariant Violation: "myAppName" has not been registered #34893
i'm trying to running on ios emulator, but without success:
Invariant Violation: "myAppName" 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
metro is started, and build, so i think the problem is:
A module failed to load due to an error and AppRegistry.registerComponent wasn't called., js engine: hermes
Version
0.70.2
Output of npx react-native info
System:
OS: macOS 12.6
CPU: (8) arm64 Apple M1 Pro
Memory: 316.59 MB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.17.1 - /usr/local/bin/node
Yarn: Not Found
npm: 8.15.0 - /usr/local/bin/npm
Watchman: 2022.07.04.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /Users/mantegnous/.rvm/gems/ruby-2.7.5/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0
Android SDK: Not Found
IDEs:
Android Studio: 2021.3 AI-213.7172.25.2113.9014738
Xcode: 14.0.1/14A400 - /usr/bin/xcodebuild
Languages:
Java: 11.0.11 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: ^18.2.0 => 18.2.0
react-native: ^0.70.2 => 0.70.2
react-native-macos: Not Found
npmGlobalPackages: react-native: Not Found
Steps to reproduce
i'm running ios
Snack, code example, screenshot, or link to a repository
Check the info before the error; that should tell you what's causing it. For me, it was react-native-reanimated.
Error: Exception in HostFunction: java.lang.NoSuchMethodError: no non-static method "Lcom/swmansion/reanimated/NativeProxy;.registerEventHandler(Lcom/swmansion/reanimated/nativeProxy/EventHandler;)V", js engine: hermes
LOG Running "AwesomeProject" with {"rootTag":11}
ERROR Invariant Violation: "AwesomeProject" 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 getting the same issue except my issue doesn't appear to be related to the js engine: hermes. @ErickJ3 solution did not work for me. I'm running 0.71.4 and testing and iOS app.
A module failed to load due to an error and AppRegistry.registerComponent wasn't called., js engine: hermes
Error: Exception in HostFunction: java.lang.NoSuchMethodError: no non-static method "Lcom/swmansion/reanimated/NativeProxy;.registerEventHandler(Lcom/swmansion/reanimated/nativeProxy/EventHandler;)V", js engine: hermes
LOG Running "naviRn" with {"rootTag":11}
i am also getting this error now even I am running this app from the folder it should we run
Maybe it's trivial, but make sure your app.config.js or app.json contains "expo" property in the JSON/JS object. In my case it was missing and produced an error "ReferenceError: Property 'TextEncoder' doesn't exist, js engine: hermes" and A module failed to load due to an error and AppRegistry.registerComponent wasn't called., js engine: hermes. I took the config example from somewhere where it wasn't defined.
So keep: {"expo": {"name": "xxx", ...}}
I got the same error in mac for ios and solved it by running
$ cd ios
$ pod install
$ cd ..
and then started the metro by cleaning cache using following command
$ npm start --reset-cache
Once I removed this alias from babel.config.js, mobile part started working correctly and web part was intact as well.
The error: "Invariant Violation: "myAppName" has not been registered" was resolved with this
Activity
muzhaqi16 commentedon Mar 10, 2023
I am getting the same error after upgrading to react native
0.71.4student513 commentedon Mar 10, 2023
same here
muzhaqi16 commentedon Mar 10, 2023
Check the info before the error; that should tell you what's causing it. For me, it was react-native-reanimated.
allanrosero commentedon Mar 14, 2023
solved the issue by updating all the packages.
brettbl commentedon Apr 1, 2023
I getting the same issue except my issue doesn't appear to be related to the js engine: hermes. @ErickJ3 solution did not work for me. I'm running 0.71.4 and testing and iOS app.
vivkikkk commentedon Apr 4, 2023
Check the App name in MainActivity at getMainComponentName function, app.json, and package.json it will same in these 3 places.
brettbl commentedon Apr 5, 2023
These all match but still experiencing the issue
aniketjha9179 commentedon Apr 9, 2023
AppRegistry.registerComponentwasn't called., js engine: hermesLOG Running "naviRn" with {"rootTag":11}
i am also getting this error now even I am running this app from the folder it should we run
Chuabacca commentedon Apr 12, 2023
@methineeinkan After using the Upgrade Helper to go to 0.71.6, I had the wrong
moduleNamein myAppDelegate.mmfile. Thanks!g-wozniak commentedon May 29, 2023
Maybe it's trivial, but make sure your app.config.js or app.json contains
"expo"property in the JSON/JS object. In my case it was missing and produced an error "ReferenceError: Property 'TextEncoder' doesn't exist, js engine: hermes" and A module failed to load due to an error andAppRegistry.registerComponentwasn't called., js engine: hermes. I took the config example from somewhere where it wasn't defined.So keep: {"expo": {"name": "xxx", ...}}
thanhdat2106 commentedon Jul 19, 2023
I'm getting the same error, anyone have any solution?
Ali-Rzaa commentedon Aug 10, 2023
I got the same error in mac for ios and solved it by running
$ cd ios
$ pod install
$ cd ..
and then started the metro by cleaning cache using following command
$ npm start --reset-cache
xieyezi commentedon Sep 20, 2023
it's fo funny, I change name in
app.json, it's not working. I don know that it's must same in these 3 places.fabio-jreis commentedon Oct 3, 2023
any solution? I got the same error runing on android
TiagoAndreAlmeida commentedon Oct 18, 2023
I got the same error, check the name os app in 3 files a the same.
joaonew commentedon Oct 30, 2023
did you fix it? experiencing the same error with hermes
afiq234 commentedon Nov 4, 2023
I fix the problem by cold boot the avd
binarybaba commentedon Nov 29, 2023
Could this be because the module fails to load and hence
AppRegistry.registerComponentdoesn't end up getting called?zecafeitosa commentedon Mar 15, 2024
thank you, saved my life :D
ronnioliveira commentedon May 15, 2024
same problem to run ios with react native 0.74. Same name in app.json, package.json and getMainComponentName. Any solution?
deban007oss commentedon May 22, 2024
same problem on 0.74
snanthagopal commentedon May 31, 2024
Same problem on 0.73.8
smit-luvani commentedon Jul 28, 2024
Were you able to resolve? Is it due to react-native-navigation (https://github.com/wix/react-native-navigation) package?
ganeshtak19 commentedon Oct 7, 2024
+1
facing same problem on 0.74.0
fionhua commentedon Oct 30, 2024
+1
facing same problem on "react-native": "0.74.5",
Sadman95 commentedon Dec 14, 2024
Hi
I am also facing the same issue though I have placed same name in the three places.
package.json

app.json

MainApplication.kt

ahmadprogrammer111 commentedon Jan 16, 2025
Yeah man it worked for me!!!
DevDK12 commentedon Jan 19, 2025
Probably this was causing error, I changed back name in app.json and its working fine now
ramilqO commentedon Jul 8, 2025
I solved this problem by changing name to required in AppRegistry.registerComponent("CORRECT_APP_NAME", () => App)
sehy0803 commentedon Jul 14, 2025
I also made sure that the project name was consistent across all settings, including app.json.
After that, I deleted the
index.android.bundlefile located atandroid/app/src/main/assets/in the project root.Then I regenerated the bundle by running the following command in the terminal:
npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundleThis resolved the issue for me.
jayeshuk commentedon Dec 31, 2025
I was having a
react-native-websetup in myreact-nativeproject to support web along with android and ios.In my case, I configured an alias which was supposed to be only in
webpack.config.js(for web) and not inbabel.config.js(for mobile):Once I removed this alias from
babel.config.js, mobile part started working correctly and web part was intact as well.The error: "Invariant Violation: "myAppName" has not been registered" was resolved with this
hariszulfiqar054 commentedon Mar 3, 2026
In my case it was a ts compile issue make sure to compile the code and resolve the error and reload the metro bundler
react-native-bot commentedon Aug 31, 2026
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
react-native-bot commentedon Sep 7, 2026
This issue was closed because it has been stalled for 7 days with no activity.