React-native-navigation: "RNNCustomViewController.h" file not found

Created on 20 Mar 2018  路  8Comments  路  Source: wix/react-native-navigation

Issue Description

I've just started a new react native project from scratch and added RNN V2. I'm getting 'RNNCustomViewController.h' file not found from AppDelegate.m. I've searched the repo for any mention of that file but can't find it anywhere. Am I missing something?

Steps to Reproduce / Code Snippets / Screenshots

/**
 * Copyright (c) 2015-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 */

#import "AppDelegate.h"
#import "RNNCustomViewController.h" <------ this can't be found

#import <React/RCTBundleURLProvider.h>
#import <ReactNativeNavigation/ReactNativeNavigation.h>

#import <React/RCTRootView.h>

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  NSURL *jsCodeLocation;

  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];

  [ReactNativeNavigation bootstrap:jsCodeLocation launchOptions:launchOptions];

  [ReactNativeNavigation registerExternalComponent:@"RNNCustomComponent" callback:^UIViewController *{
    return [[RNNCustomViewController alloc] init];
  }];

  return YES;
}

@end

Environment

  • React Native Navigation version: 2.0.2161
  • React Native version: 0.54.2
  • Platform(s) (iOS, Android, or both?): iOS
  • Device info (Simulator/Device? OS version? Debug/Release?): Simulator Debug

Most helpful comment

This file is an example for custom native ViewController. You should not have this in your AppDelegate
Remove those lines:

#import "RNNCustomViewController.h"

[ReactNativeNavigation registerExternalComponent:@"RNNCustomComponent" callback:^UIViewController *{
    return [[RNNCustomViewController alloc] init];
  }];

All 8 comments

Hi @MyGuySi,

I'm currently struggling with similar issue. The file you mentioned above can be found here.
Please check if it appears under node_modules/lib/ios. If not, please remove node_modules and try installing once again. It helped me, but I got stuck at next step during the linking process -

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_RNNCustomViewController", referenced from:
      objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Please tell me if you were able to link the library.

@MyGuySi moving to https://discordapp.com/invite/DhkZjq2 with the issue, seems to be a more appropriate place for this type of questions :)

@marysieek I can see the file in that directory but it doesn鈥檛 seem to be part of the RNN XCode project that we add to our own projects... can鈥檛 see it anywhere in XCode which would explain why it can鈥檛 be found

I'm having the same problem

Hey I solved it. Just drag the RNNcustomview .h and .m files into the home directory with Appdelegate. Working fine for me now

@sajsanghvi it鈥檚 a temporary fix but not sure that鈥檚 how we should be doing it. It needs to be part of the RNN project that gets added when integrating

This file is an example for custom native ViewController. You should not have this in your AppDelegate
Remove those lines:

#import "RNNCustomViewController.h"

[ReactNativeNavigation registerExternalComponent:@"RNNCustomComponent" callback:^UIViewController *{
    return [[RNNCustomViewController alloc] init];
  }];

@MyGuySi @marysieek - were either of you able to resolve this issue?

Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_RNNCustomViewController", referenced from: objc-class-ref in AppDelegate.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

I've tried adding RNNcustomview .h and .m files into the home directory with Appdelegate of Xcode, but the error persists.

Was this page helpful?
0 / 5 - 0 ratings