获取错误:
严重错误:找不到'React / RCTEventEmitter.h'文件
我刚刚开始学习React Native。
我正在使用React Native的官方文档来构建iOS应用。
我还按照以下步骤安装了react-native-cli,然后使用react-native init cmd创建了一个项目。但是,一旦在运行react-native run-ios时创建了项目,它就会显示致命错误:找不到'React / RCTEventEmitter.h'文件
以下是日志:
info In file included from /Users/cci/Work/React Native/My Projects/HelloWorld/node_modules/react-native/Libraries/Geolocation/RCTLocationObserver.m:8:
/Users/cci/Work/React Native/My Projects/HelloWorld/node_modules/react-native/Libraries/Geolocation/RCTLocationObserver.h:8:9: fatal error: 'React/RCTEventEmitter.h' file not found
#import <React/RCTEventEmitter.h>
^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
info
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening HelloWorld.xcodeproj
** BUILD FAILED **
The following commands produced analyzer issues:
Analyze Base/RCTModuleMethod.mm
Analyze Modules/RCTUIManager.m
(2 commands with analyzer issues)
The following build commands failed:
CompileC build/RCTGeolocation.build/Debug-iphonesimulator/RCTGeolocation.build/Objects-normal/x86_64/RCTLocationObserver.o RCTLocationObserver.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
. Run CLI with --verbose flag for more details.