react-native: Invariant Violation: "myAppName" has not been registered

Description

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

image

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 7
  • Comments: 33

Most upvoted comments

Check the App name in MainActivity at getMainComponentName function, app.json, and package.json it will same in these 3 places.

I’m getting this on RN 0.71, any solution?

Problem solved by fixing deprecated-react-native-prop-types

I am getting the same error after upgrading to react native 0.71.4

Check the App name in MainActivity at getMainComponentName function, app.json, and package.json it will same in these 3 places.

@methineeinkan After using the Upgrade Helper to go to 0.71.6, I had the wrong moduleName in my AppDelegate.mm file. Thanks!

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.

having the same problem

I fix the problem by cold boot the avd