我正在构建一个React Native应用程序,并使用React Native Navigation在屏幕之间移动。发生了什么事,一些文件被删除了,好像我的xcode项目设置被擦除了。
当我使用“ npm run start”和“ react-native run-ios --simulator =“ iPhoneX”来启动应用程序时,出现以下错误:
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)
我遵循了以下指示:https://wix.github.io/react-native-navigation/#/docs/Installing
版本:
App.js:
import { Navigation } from 'react-native-navigation';
import AuthScreen from './src/screens/Auth/Auth';
import SequencesList from './src/screens/SequencesList/SequencesList';
Navigation.registerComponent("my-app.AuthScreen", () => AuthScreen);
Navigation.registerComponent("my-app.App", () => App);
Navigation.registerComponent("my-app.SequencesList", () => SequencesList);
Navigation.startSingleScreenApp({
screen: {
screen: "my-app.SequencesList",
title: "Sequences"
}
});
AppDelegate.m
#import "AppDelegate.h"
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <ReactNativeNavigation/ReactNativeNavigation.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSURL *jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
[ReactNativeNavigation bootstrap:jsCodeLocation launchOptions:launchOptions];
return YES;
}
@end
标题搜索路径已设置为:$(SRCROOT)/../node_modules/react-native-navigation/lib/ios
答案 0 :(得分:1)
setRoot({stack})
startSingleScreenApp(params)
的瞬间
您正在使用react-native-navigation版本2。检查api更改日志