我正在使用React-Native并试图构建一个Hello-world应用程序,但是,我仍然无法运行该应用程序。如果我运行react-native run-ios
,则会出现此错误:
...
Build system information
unexpected service error: The Xcode build system has crashed. Please close and reopen your workspace.
Build system information
error: unexpected service error: The Xcode build system has crashed. Please close and reopen your workspace.
** BUILD FAILED **
The following commands produced analyzer issues:
Analyze /Users/adam/react-native_dev/JustATributeApp/node_modules/react-native/React/Base/RCTModuleMethod.mm normal x86_64
(1 command with analyzer issues)
The following build commands failed:
Analyze /Users/adam/react-native_dev/JustATributeApp/node_modules/react-native/Libraries/Text/RCTTextAttributes.m normal x86_64
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/JustATributeApp.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/JustATributeApp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
我发现了很多与此错误有关的主题,但没有一个导致解决这个问题。
以下是一些其他信息:
react-native-cli: 2.0.1
react-native: 0.56.0
xcode 10.0 beta 2 (10L177m)
如何调试/修复此问题?
谢谢
答案 0 :(得分:1)
错误消息的关键是Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
,这是我们可以解决的方法。
在Xcode中打开yourprojectname.xcodeproj,然后在“常规”标签下检查包标识符。它应该有一个值。我的是com.yourprojectname.app.ios.triplets。如果该字段为空白,则将捆绑商品标识符设置为某物。修改此字段将对您的info.plist进行更改。
答案 1 :(得分:0)
我建议重新启动React。
为此,只需运行以下命令:
# Kill current processes
killall node -9
# Start React - Native
react-native start
# Run android
react-native run-android or react-native run-ios
应该可以解决问题。