"CFBundleIdentifier"不存在。

5

我在 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

但是我看到Info.plist中的CFBundleIdentifier如下。

<key>CFBundleIdentifier</key>
<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>

我也尝试将上述内容更改为
<key>CFBundleIdentifier</key>
 <string>com.myApp</string>

但是还是出现了同样的错误。请帮忙。
在上述错误之前,我也看到以下错误被显示出来:
node_modules/react-native-fbsdk/ios/RCTFBSDK/share/RCTFBSDKShareDialog.h:21:9: fatal error: 
      'FBSDKShareKit/FBSDKShareKit.h' file not found
#import <FBSDKShareKit/FBSDKShareKit.h>
3个回答

5
在遇到这个错误后,我找到了解决方法。问题出在pods上,可能是在更新某些库时,pods没有同步。
我的解决方案: 前往/ios文件夹---->运行以下命令: ·

pod install && pod update

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

rm -rf node_modules && npm install

清理ios构建文件夹: ·

rm -rf ios/build

完成以上步骤后,像往常一样运行即可: ·

react-native run-ios


2

你可以尝试将其更改为$(PRODUCT_BUNDLE_IDENTIFIER)


2
我已经设置了这个值。$(foo) 究竟是如何工作的?也许我需要在其他地方设置环境值? - Harry Moreno

-4
问题已经解决,将Facebook rnfbsdk框架放在~/documents/文件夹中即可。

2
我认为这个答案不完整。 - Emmanuelguther

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接