React-native-navigation: [V3] Invariant Violation: "AppName" has not been registered

Created on 11 Oct 2019  路  7Comments  路  Source: wix/react-native-navigation

Issue Description

That issue's like #5520, the problem? That issue just resolving problem with [V3]RNN install in iOS.
My problem is with Android 9

App.js look great:

import {Navigation} from 'react-native-navigation';
import App from './App';

Navigation.registerComponent('main.AppScreen', () => App);

Navigation.events().registerAppLaunchedListener(() => {
  Navigation.setRoot({
    root: {
      component: {
        name: 'main.AppScreen',
      },
    },
  });
});

Environment

  • React Native Navigation version: 3.2.0
  • React Native version:0.61.2
  • Platform(s) (iOS, Android, or both?): Android
  • Device info (Simulator/Device? OS version? Debug/Release?): Simulator Pixel 3a API 28
    Android 9

Most helpful comment

look at the file app.json and package.json and check same name field both files, maybe them difference.

All 7 comments

look at the file app.json and package.json and check same name field both files, maybe them difference.

You've missed the installation parts with AppDelegate.m file

@oviedo97fer I have the same issue on Android and RNN 3.3.0 (and all v3 versions apparently). I'm running with RN 0.61.3.

Did you find a solution?

@oviedo97fer I have the same issue on Android and RNN 3.3.0 (and all v3 versions apparently). I'm running with RN 0.61.3.

Did you find a solution?

yes
but my error was that the documentation did not clarify that all of the following should be copied:
image
Not only:
image

You've missed the installation parts with AppDelegate.m file

I had this issue, in my own case i was doing everything in AppDelegate.m file but there was a bridging code so i had to remove it.

Comment out this line of code

`RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"raajneti"
initialProperties:nil];

rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];

self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];`

For ios it works fine, i also face the same issue in android.

Was this page helpful?
0 / 5 - 0 ratings