在运行react-native init之后,我无法立即构建一个普通的react-native项目。我尚未对该项目进行任何更改,也未运行其他命令。
命令/输出:
> react-native init AwesomeProject
> cd AwesomeProject
> react-native run-ios
....
** BUILD FAILED **
The following commands produced analyzer issues:
Analyze Base/RCTModuleMethod.mm normal x86_64
Analyze RCTVibration.m normal x86_64
(2 commands with analyzer issues)
The following build commands failed:
CompileC build/RCTVibration.build/Debug-iphonesimulator/RCTVibration.build/Objects-normal/x86_64/RCTVibration.o RCTVibration.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/AwesomeProject57.app
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=164):
Unable to lookup in current state: Shutdown
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/AwesomeProject57.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/AwesomeProject57.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
at checkExecSyncError (child_process.js:601:13)
at Object.execFileSync (child_process.js:621:13)
at Promise.then (/Users/local/common/native-attempt/AwesomeProject57/node_modules/react-native/local-cli/runIOS/runIOS.js:208:5)
at <anonymous>
Mac OS X:10.3.4 XCode:9.4.1 反应本机:0.57 反应:16.5.0
package.json:
{
"name": "AwesomeProject",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.5.0",
"react-native": "0.57.0"
},
"devDependencies": {
"babel-jest": "23.6.0",
"jest": "23.6.0",
"metro-react-native-babel-preset": "0.45.2",
"react-test-renderer": "16.5.0"
},
"jest": {
"preset": "react-native"
}
}
环顾StackOverflow之后,我尝试了:
使用react-native run-ios仍然失败。 FWIW,我确实在XCode中打开了该项目,并尝试在那里进行构建。我收到一个构建错误“ /Users/local/common/native-attempt/AwesomeProject/node_modules/react-native/Libraries/Text/RawText/RCTRawTextViewViewManager.h:8:9:'React / RCTViewManager.h'文件未找到” 。不同的错误,但我认为这是相关的。
真的把我的头发拔掉了...感激不尽。