确保应用程序的 Info.plist 包含 CFBundleIdentifier 的值。打印:条目,“:CFBundleIdentifier”,不存在

waf*_*lop 11 info.plist cfbundleidentifier ios discourse react-native

我正在尝试使用此存储库构建我的第一个 iOS 应用程序:\n https://github.com/pmusaraj/discourse-mobile-single-site-app

\n\n

构建时,我收到错误并且无法继续。我是一个绝对的菜鸟,会花很长时间在这上面,但不知道我\xe2\x80\x99是否已经达到了代码中的故障点,我可以通过一些简单的调整来超越,或者我是否必须等待我的代码由开发人员解决的问题(在存储库上打开)。我认为开发人员正忙于其他项目,可能没有时间提供帮助。

\n\n

也许我的软件对此来说太新了?我应该尝试将版本控制回react-native 和XCode 吗?我可以降级到 XCode 9.2(2017 年 12 月至 2018 年 3 月版本)并将 React-native 降级到 0.53.0(2018 年 1 月版本)。
\n我的机器:
\nMac OSX:10.14.6
\nreact-native-cli:2.0.1
\nreact-native:0.58.6
\nXCode:10.3(内部版本 10G8)

\n\n

问题:info.plist 文件无法与构建器很好地配合。在 /ios/DiscoSingle/Info.plist 中,我看到 CFBundleIdentifier 正确定义为:

\n\n
<key>CFBundleIdentifier</key>\n<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>\n
Run Code Online (Sandbox Code Playgroud)\n\n

这对我来说看起来是正确的。

\n\n

这里\xe2\x80\x99s运行时出现错误react-native ios-build

\n\n
The following build commands failed:\n    Ld /Users/user919021/Desktop/discourse/ios/build/Build/Products/Debug-iphonesimulator/DiscoSingle.app/DiscoSingle normal x86_64\n(1 failure)\n\nInstalling build/Build/Products/Debug-iphonesimulator/DiscoSingle.app\nAn error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):\nFailed to install the requested application\nThe bundle identifier of the application could not be determined.\nEnsure that the application\'s Info.plist contains a value for CFBundleIdentifier.\nPrint: Entry, ":CFBundleIdentifier", Does Not Exist\n\nCommand failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/DiscoSingle.app/Info.plist\nPrint: Entry, ":CFBundleIdentifier", Does Not Exist\n\n\nError: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/DiscoSingle.app/Info.plist\nPrint: Entry, ":CFBundleIdentifier", Does Not Exist\n\n    at checkExecSyncError (child_process.js:629:11)\n    at Object.execFileSync (child_process.js:647:13)\n    at Promise.then (/Users/user919021/Desktop/discourse/node_modules/react-native/local-cli/runIOS/runIOS.js:208:5)\n    at process._tickCallback (internal/process/next_tick.js:68:7)\n
Run Code Online (Sandbox Code Playgroud)\n

小智 6

根据我的经验,您的 git 中的捆绑包标识符名称被忘记填写。因此,您必须在 info plist> 签名和功能中添加该包标识符名称。您可以添加以下内容:com.habiesmart.myapps 等。就像这样,尤里卡!你可以运行那个项目!

这张图片可能对你有帮助

最好的,哈比。