upgrade-support icon indicating copy to clipboard operation
upgrade-support copied to clipboard

Invariant Violation: "Appname" has not been registered

Open sandeeptheminery opened this issue 2 years ago • 16 comments

React Native ios app - XCode(Version 13.2.1) , Mac M1

react-native info log

warn Package react-native-firebase contains invalid configuration: "dependency.platforms.ios.podspecPath" is not allowed. Please verify it's properly linked using "react-native config" command and contact the package maintainers about this. warn Package rn-fetch-blob contains invalid configuration: "dependency.hooks" is not allowed. Please verify it's properly linked using "react-native config" command and contact the package maintainers about this. info Fetching system and libraries information... (node:10196) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency (Use node --trace-warnings ... to show where the warning was created) System: OS: macOS 12.2.1 CPU: (8) x64 Apple M1 Memory: 35.66 MB / 8.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.10.0 - /usr/local/bin/node Yarn: 1.22.17 - /usr/local/bin/yarn npm: 8.19.3 - /opt/homebrew/bin/npm Watchman: 2022.03.21.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3 Android SDK: Not Found IDEs: Android Studio: Not Found Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild Languages: Java: Not Found npmPackages: @react-native-community/cli: ^10.1.3 => 10.1.3 react: 18.2.0 => 18.2.0 react-native: 0.71.1 => 0.71.1 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Things I’ve done to figure out my issue

upgraded from react native 0.61.5 to 0.71.1

Description

After upgrading the ios app build works but while loading on simulator it throws this error

Invariant Violation: "Appname" 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 checked appName in AppRegistry.registerComponent its correct and same as before upgrade. I also tried reset cache, removed simulator data and also rebuild the project again but it didn't work, please help!

image

sandeeptheminery avatar Jan 26 '23 20:01 sandeeptheminery

I'm facing the same issue upgrading to 0.71.1 with M1

fgarcia92 avatar Jan 31 '23 15:01 fgarcia92

I'm facing the same issue upgrading to 0.71.1 with M1

I don't know if you have solved this problem. I hope you can be prompted. Thank you

feige-2011 avatar Feb 24 '23 00:02 feige-2011

I had the same error after upgrading from 0.68.2 to 0.71.3 The Appname is case sensitive, so check all Appname strings in the code.

In my case it was the new line (9) in AppDelegate.mm self.moduleName = @"Appname"; ==> self.moduleName = @"appname";

Ascor52 avatar Mar 02 '23 12:03 Ascor52

Am stuck with this issue... anyone with a solution?

theambidextrous avatar Apr 09 '23 19:04 theambidextrous

try to upgrade react-native-reanimated

"react-native-reanimated": "3.0.2"

I fix this error at android platform

renopp avatar Apr 27 '23 01:04 renopp

Am stuck with this issue... anyone with a solution?

@theambidextrous Have you tried to use the JSC engine? I solve the issue by disabling hermes engine and using JSC, after switching to JSC engine the error showed and it was caused by react-native-reanimated

renopp avatar Apr 27 '23 02:04 renopp

Appname is case sensitive, so c

This Worked 💯

ARIPRASATH4664 avatar Jun 01 '23 03:06 ARIPRASATH4664

I dont have AppDelegate.mm file in folder structure

Pratik-2102 avatar Jul 20 '23 08:07 Pratik-2102

I dont have AppDelegate.mm file in folder structure

@Pratik-2102 Do you have AppDelegate.m in the folder ?

ARIPRASATH4664 avatar Jul 20 '23 09:07 ARIPRASATH4664

yes. I have this file

I dont have AppDelegate.mm file in folder structure

@Pratik-2102 Do you have AppDelegate.m in the folder ?

Pratik-2102 avatar Jul 20 '23 09:07 Pratik-2102

@Pratik-2102 Perfect please do change the name as per your Module name in AppDelegate.m 👍🏼 Hope that Works

ARIPRASATH4664 avatar Jul 20 '23 09:07 ARIPRASATH4664

Also you can try signing & Capabilities and adding a team

GusCarreno avatar Apr 30 '24 04:04 GusCarreno

for me the issue happen after upgrading from 0.63 to 0.68, fixed by updating this line in AppDelegate.mm

UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"appName", nil);

@"appName" => must match the name in package.json

prox2 avatar Jul 30 '24 09:07 prox2

Also, you should check the name prop in app.json file.

onurravli avatar Aug 12 '24 09:08 onurravli

After I updated all packages with yarn-upgrade-all I got two errors:

  1. middleware is not a function (it is undefined), js engine: hermes is related to redux
  2. Invariant Violation: "MyAppName" has not been registered

In my case importing of thunk was changed, so to solve the problem I replaced

import thunk from 'redux-thunk' // 2.4.2

with

import { thunk } from 'redux-thunk' // 3.1.0

and no more errors.

grishkovelli avatar Aug 18 '24 10:08 grishkovelli