CFBundleIdentifier", 不存在

use*_*286 5 iphone ios react-native

我在为 iOS 响应本机应用程序时遇到以下错误。

Installing build/Build/Products/Debug-iphonesimulator/Este.app
    An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
    Failed to install the requested application
    An application bundle was not found at the provided path.
    Provide a valid path to the desired application bundle.
    Print: Entry, ":CFBundleIdentifier", Does Not Exist

    Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/Este.app/Info.plist
    Print: Entry, ":CFBundleIdentifier", Does Not Exist
Run Code Online (Sandbox Code Playgroud)

但我看到 Info.plist 有 CFBundleIdentifier 如下。

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

我也尝试将上述更改为

<key>CFBundleIdentifier</key>
 <string>com.myApp</string>
Run Code Online (Sandbox Code Playgroud)

但同样的错误。请帮忙。

我还看到在上述错误之前显示以下错误

node_modules/react-native-fbsdk/ios/RCTFBSDK/share/RCTFBSDKShareDialog.h:21:9: fatal error: 
      'FBSDKShareKit/FBSDKShareKit.h' file not found
#import <FBSDKShareKit/FBSDKShareKit.h>
Run Code Online (Sandbox Code Playgroud)

Emm*_*her 5

在我因这个错误而浪费时间后,我找到了解决方案,问题出在 pod 上,可能是在更新某些库时,pod 没有同步。

我的解决方案: 转到/ios文件夹---->并运行命令:·

pod 安装 && pod 更新

  • 返回项目文件夹后---->并运行命令:·

rm -rf node_modules && npm install

清理 ios 构建文件夹:·

rm -rf ios/build

之后,就照常运行: ·

react-native run-ios


use*_*286 -4

将 facebook rnfbsdk 框架放入 ~/documents/ 文件夹后问题解决。

  • 我认为这个答案不完整 (2认同)