Skip to content

Invariant Violation: "myAppName" has not been registered #34893

Closed as not planned

Description

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

Activity

  1. Daha62 commented on Oct 26, 2022

    @Daha62

    having the same problem

  2. Daha62 commented on Oct 31, 2022

    @Daha62

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

  3. flexbox commented on Jan 5, 2023

    @flexbox

    Hey @Daha62

    If your problem is solved can you please close the issue?
    It sparks joy for maintainers ✨

  4. sam-houle1 commented on Jan 12, 2023

    @sam-houle1

    @mantegnous did you fix the issue ? I'm having the same problem, solving the deprecated-react-native-prop-types issues did not help.

  5. AlessioCamm commented on Jan 16, 2023

    @AlessioCamm

    Someone has fix this issue ? I got the error with Android, but not with iOS.

  6. RalissonMattias commented on Jan 17, 2023

    @RalissonMattias

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

  7. sam-houle1 commented on Jan 17, 2023

    @sam-houle1

    I had this issue on 0.88.5, but the reason I had this error is because I'm using wix/react-native-navigation, I had to enter npx rnn-link to resolve this issue.

    Could also be because in some native file, the project name is still have some rndiffapp in some native file.

  8. Yeasirarafat53 commented on Jan 31, 2023

    @Yeasirarafat53

    anyone solved this issue?

  9. Sulemannnn commented on Feb 7, 2023

    @Sulemannnn

    i solved this problem by ending adb(32bit) from task manager then i run the project on my real device it successful worked

  10. Sulemannnn commented on Feb 7, 2023

    @Sulemannnn

    i solved this problem by ending adb(32bit) from task manager then i run the project on my real device it successful worked

    let me know if this works for you guys as well thanks!

  11. AdeelTanveerM commented on Feb 11, 2023

    @AdeelTanveerM

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

    Same here.

  12. Haqan797 commented on Mar 1, 2023

    @Haqan797
  13. hassanharoon321 commented on Mar 10, 2023

    @hassanharoon321

    any solution?

  14. 21 remaining items

  15. snanthagopal commented on May 31, 2024

    @snanthagopal

    Same problem on 0.73.8

  16. smit-luvani commented on Jul 28, 2024

    @smit-luvani

    same problem to run ios with react native 0.74. Same name in app.json, package.json and getMainComponentName. Any solution?

    Were you able to resolve? Is it due to react-native-navigation (https://github.com/wix/react-native-navigation) package?

  17. ganeshtak19 commented on Oct 7, 2024

    @ganeshtak19

    +1
    facing same problem on 0.74.0

  18. fionhua commented on Oct 30, 2024

    @fionhua

    +1
    facing same problem on "react-native": "0.74.5",

  19. Sadman95 commented on Dec 14, 2024

    @Sadman95

    Hi
    I am also facing the same issue though I have placed same name in the three places.

    • package.json
      image

    • app.json
      image

    • MainApplication.kt
      image

  20. ahmadprogrammer111 commented on Jan 16, 2025

    @ahmadprogrammer111

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

    Yeah man it worked for me!!!

  21. DevDK12 commented on Jan 19, 2025

    @DevDK12

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

    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.

    Probably this was causing error, I changed back name in app.json and its working fine now

  22. ramilqO commented on Jul 8, 2025

    @ramilqO

    I solved this problem by changing name to required in AppRegistry.registerComponent("CORRECT_APP_NAME", () => App)

  23. sehy0803 commented on Jul 14, 2025

    @sehy0803

    I also made sure that the project name was consistent across all settings, including app.json.

    After that, I deleted the index.android.bundle file located at android/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.bundle

    This resolved the issue for me.

  24. jayeshuk commented on Dec 31, 2025

    @jayeshuk

    I was having a react-native-web setup in my react-native project 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 in babel.config.js (for mobile):

    resolve: {
        alias: {
          'react-native$': 'react-native-web',
        },
      },
    

    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

  25. hariszulfiqar054 commented on Mar 3, 2026

    @hariszulfiqar054

    In my case it was a ts compile issue make sure to compile the code and resolve the error and reload the metro bundler

  26. react-native-bot commented on Aug 31, 2026

    @react-native-bot
    Collaborator

    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.

  27. added
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    on Aug 31, 2026
  28. react-native-bot commented on Sep 7, 2026

    @react-native-bot
    Collaborator

    This issue was closed because it has been stalled for 7 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Triage 🔍StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions