我正在尝试使用此存储库构建我的第一个 iOS 应用程序: https ://github.com/pmusaraj/discourse-mobile-single-site-app
构建时,我收到一个错误,无法继续前进。我是一个绝对的菜鸟,会花很长时间在这上面,但不知道我是否已经在代码中达到了一个失败点,我可以通过一些简单的调整来超越,或者我是否必须等待我的问题(打开于回购)由开发人员解决。我认为开发人员正忙于其他项目,可能没有时间提供帮助。
也许我的软件太新了?我应该尝试对 react-native 和 XCode 进行版本控制吗?我可以降级到 XCode 9.2(2017 年 12 月到 2018 年 3 月的版本)和 react-native 到 0.53.0(2018 年 1 月的版本)。
我的机器:
Mac OSX:10.14.6
react-native-cli:2.0.1
react-native:0.58.6
XCode:10.3(build 10G8)
问题:info.plist 文件不能很好地与构建器配合使用。在 /ios/DiscoSingle/Info.plist 中,我看到 CFBundleIdentifier 正确定义为:
<key>CFBundleIdentifier</key>
<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>
这对我来说是正确的。
这是运行时的错误react-native ios-build
:
The following build commands failed:
Ld /Users/user919021/Desktop/discourse/ios/build/Build/Products/Debug-iphonesimulator/DiscoSingle.app/DiscoSingle normal x86_64
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/DiscoSingle.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/DiscoSingle.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/DiscoSingle.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
at checkExecSyncError (child_process.js:629:11)
at Object.execFileSync (child_process.js:647:13)
at Promise.then (/Users/user919021/Desktop/discourse/node_modules/react-native/local-cli/runIOS/runIOS.js:208:5)
at process._tickCallback (internal/process/next_tick.js:68:7)