打印:条目“:CFBundleIdentifier”不存在

ios IOS

Near飞云

2020-03-12

当我运行时react-native run-ios,构建成功,但出现以下错误。我检查了整个地方,但似乎没有任何反应。sudo在命令前面使用也无济于事。我正在使用Xcode 7.3,react-native-cli:0.2.0,react-native:0.24.1,节点v5.11.0。

=== BUILD TARGET mobileTests OF PROJECT mobile WITH CONFIGURATION Release ===

Check dependencies

** BUILD SUCCEEDED **

Installing build/Build/Products/Debug-iphonesimulator/mobile.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
/Users/astiefel/workspace/bosspayments/mobile/node_modules/promise/lib/done.js:10
      throw err;
      ^

Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/mobile.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

    at checkExecSyncError (child_process.js:470:13)
    at Object.execFileSync (child_process.js:490:13)
    at _runIOS (runIOS.js:91:34)
    at runIOS.js:24:5
    at tryCallTwo (/Users/astiefel/workspace/bosspayments/mobile/node_modules/promise/lib/core.js:45:5)
    at doResolve (/Users/astiefel/workspace/bosspayments/mobile/node_modules/promise/lib/core.js:200:13)
    at new Promise (/Users/astiefel/workspace/bosspayments/mobile/node_modules/promise/lib/core.js:66:3)
    at Array.runIOS (runIOS.js:23:10)
    at Object.run (/Users/astiefel/workspace/bosspayments/mobile/node_modules/react-native/local-cli/cli.js:86:13)
    at Object.<anonymous> (/usr/local/lib/node_modules/react-native-cli/index.js:88:7)

第911篇《打印:条目“:CFBundleIdentifier”不存在》来自Winter(https://github.com/aiyld/aiyld.github.io)的站点

28个回答
樱泡芙 2020.03.12

根本原因是部署端口不是免费的。您可以重新启动设备并释放所有端口,否则运行$ lsof -i :8081并找到占用端口8081的进程。通过运行命令杀死正在使用端口8081的进程$ kill -9 {process_which_is_running_under_8081}

梅斯丁 2020.03.12

我找到了解决问题的方法:不要在项目路径中使用空间!😄

TomL 2020.03.12

当您运行npm install命令一段时间后出现互联网问题时,文件node_modules\react-native\third-party未正确下载,因此请检查是否已正确下载,否则请删除node_modules并重新安装

然后运行react-native run-ios 命令

卡卡西Itachi 2020.03.12

这对我有用。遵循步骤https://facebook.github.io/react-native/docs/getting-started.html(使用本机代码构建项目)。

在运行 react-native run-ios命令之前,请从https://sourceforge.net/projects/boost/files/boost/1.63.0/下载boost节点模块,并替换node_modules / react-native / third-party / boost_1_63_0

现在运行 react-native run-ios 命令

Eva梅村村 2020.03.12

补充,当以上方法均无法解决时,它对我有用:

  1. 安装react-native-git-upgrade并更新您的项目。 npm i -g react-native-git-upgrade && react-native-git-upgrade
  2. 打开Xcode->文件->项目设置->高级。
  3. 选择“ 自定义 ”,然后选择“ 相对于工作区 ”,然后单击完成。
  4. 更新您的CLI。 npm i -g react-native-cli
  5. 更新您的Nodejs 8和NPM。nvm install --ltsnvm install-latest-npm
  6. 删除ios / build和node_modules(在您的项目根路径中)
  7. 再次使用npm installreact-native run-ios,并给我一个拥抱:-)

它终于可以在这里工作了。

  • Mac OS High Sierra 10.13.4
  • Xcode 9.3
  • NPM 5.8.0
  • 节点8.11.1
  • RN 0.55.2
路易Near番长 2020.03.12

对我有用的方法单击导航器中的RCTWebSocket项目,然后删除构建设置>自定义编译器标志下的标志。 在此处输入图片说明

小哥番长番长 2020.03.12

错误消息类似于 The domain/default pair of (../ios/Runner/Info, CFBundleIdentifier) does not exist

意味着Xcode认为您plist拥有invalid format content

您需要粘贴Info.plist文件的内容以找出该文件的问题。

一个可能的问题是,此<key>s和<values>s(<array>s,<string>s或<bool>s)配对不正确。例如:

<key>UISupportedInterfaceOrientations</key>         //<------ here is the key
<key>NSPhotoLibraryUsageDescription</key>
<key>NSCameraUsageDescription</key>
<string>Tagueo necesita usar la camara</string>
<key>NSMicrophoneUsageDescription</key>
<string>Tagueo necesita usar el microfono</string>
<array>                                            //<------ here is the value
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>   //<------ please compare this key
<array>                                            //<------ please compare this value
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationPortraitUpsideDown</string>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>

您只需要移动keyvalue聚集

<key>UISupportedInterfaceOrientations</key>        //<------ here is the key
<array>                                            //<------ follow with the value
   <string>UIInterfaceOrientationPortrait</string>
   <string>UIInterfaceOrientationLandscapeLeft</string>
   <string>UIInterfaceOrientationLandscapeRight</string>
</array>
乐米亚 2020.03.12

对我来说,这是由cocoapods管理的ios依赖关系。

必须这样做:

$ cd ToProject/ios

$ pod install

$ react-native run-ios

这对我有用

https://shift.infinite.red/beginner-s-guide-to-using-cocoapods-with-react-native-46cb4d372995

PS:试图找出别人完成的工作

斯丁Davaid 2020.03.12

所有这些解决方案建议对我都不起作用。我刚刚创建了一个rn 0.58.5项目。并与我的项目进行比较。我看到JavaScriptCore.frameworkBuild Phasess> 没有任何内容Link Binary With Libraries拖放后,JavaScriptCore react-native run-ios构建成功。

JavaScriptCore.framework 位置: ‎⁨Macintosh HD⁩ ▸ ⁨Applications⁩ ▸ ⁨Xcode⁩ ▸ ⁨Contents⁩ ▸ ⁨Developer⁩ ▸ ⁨Platforms⁩ ▸ ⁨iPhoneOS.platform⁩ ▸ ⁨Developer⁩ ▸ ⁨SDKs⁩ ▸ ⁨iPhoneOS.sdk⁩ ▸ ⁨System⁩ ▸ ⁨Library⁩ ▸ ⁨Frameworks⁩

JavaScriptCore.framework

null 2020.03.12

xcode 10.1对我来说使用此版本是可行的

"react": "16.6.0-alpha.8af6728",
"react-native": "0.57.4"
蛋蛋樱 2020.03.12

经过几个月的尝试,我终于将操作系统更新为Sierra,将XCode更新为最新版本,并且所有错误均消失了。希望这可以帮助一些人!

宝儿猪猪 2020.03.12

0.44可以运行,但是0.45不能运行,也许是我通过以下命令解决了版本问题:rninit init TaxiApp --source react-native@0.44.0;

飞云逆天 2020.03.12

由于删除了一些我在Xcode中不使用的模拟器,我的终端弹出了相同的消息。

如果react-native run-ios没有特定参数运行,则react-native将运行默认模拟器,在我的情况下为iPhone 6,带有iOS 10.3.1,我偶然删除了该模拟器。

这是我的错误消息:

xcodebuild: error: Unable to find a destination matching the provided destination specifier:
        { id:F3A7BF54-B827-4517-A30D-8B3241C8EBF8 }

Available destinations for the "albums" scheme:
    { platform:iOS Simulator, id:CD64F26B-045A-4E27-B05A-5255924095FB, OS:10.3.1, name:iPad Pro (9.7 inch) }
    { platform:iOS Simulator, id:8FC41950-9E60-4264-B8B6-20E62FAB3BD0, OS:10.3.1, name:iPad Pro (10.5-inch) }
    { platform:iOS Simulator, id:991C8B5F-49E2-4BB7-BBB6-2F5D1776F8D2, OS:10.3.1, name:iPad Pro (12.9 inch) }
    { platform:iOS Simulator, id:B9A80D04-E43F-43E3-9CA5-21137F7C673D, OS:10.3.1, name:iPhone 7 }
    { platform:iOS Simulator, id:58F6514E-185B-4B12-9336-B8A1D4E901F8, OS:10.3.1, name:iPhone 7 Plus }

Installing build/Build/Products/Debug-iphonesimulator/myapp.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/myapp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

为了摆脱这些,打开您的Xcode并检查可用的模拟器(与列出的终端相同)并运行 react-native run-ios --simulator="your device name"

就我而言,我运行react-native run-ios --simulator="iPhone 7",问题解决了。

Sam猪猪 2020.03.12

我将Xcode更新为v8,此错误已解决。

橙ぺo痕 2020.03.12

您可以按照以下步骤解决此错误:

步骤1

Open terminal

第2步

cd node_modules/react-native/third-party

第三步

ls

Copy or identify glog-{version}

步骤4

cd ../../../

第5步

cd node_modules/react-native/third-party/glog-{version}

第6步

./configure

我希望这会工作!

Sam小哥理查德 2020.03.12

就我而言,我从git中提取项目,它还包含ios文件夹。

首先,我删除ios文件夹,rm -rf ios 然后,react-native upgrade

Jim老丝梅 2020.03.12

我已经尝试了所有这些解决方案,但是对我有用的是:

  1. react-native upgrade
  2. 打开xcode
  3. 在xCode中运行应用程序
  4. 工作良好!
梅米亚 2020.03.12

您是否检查过声明了捆绑包标识符?您可以通过以下方式执行此操作:单击xcode中的项目文件,然后选择常规选项卡,该选项卡将在“身份”下的第一个文本框下列出。另一种检查方法是在项目的ios文件夹中检入info.plist文件。这就是它在我的info.plist中显示的方式。我项目的实际捆绑包标识符在xcode中。

<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
卡卡西逆天十三 2020.03.12

对我来说,使用Cocoapods和意外地设置模块是一个问题react-native link

不要将这两个模块混合使用!

老丝阿飞 2020.03.12

我通过删除/build/react-native run-ios重新运行来解决此问题

YOC40059608 2020.03.12

安装新软件包后,我的node_modules文件夹出现问题时,我发生了这种情况。我杀死了该文件夹rm -rf node_modules,然后npm install重新安装了我的软件包,并对其进行了修复。

Stafan逆天 2020.03.12

Print: Entry, ":CFBundleIdentifier", Does Not Exist消息仅表示您的项目无法编译或链接。您需要返回到输出,以找到有关实际根本原因的提示。

如果遇到问题,请查看完整的构建输出,而不仅仅是最后几行。您可能需要在Xcode中打开项目,然后按⌘B进行构建。Xcode中的生成错误应可帮助您找到失败的根本原因。

番长凯 2020.03.12

我也遇到了这个问题,我找到了一种解决方法

这是我所做的:

1)确保文件目录中没有空格。

2)cd 项目目录

3)运行命令react-native升级

4)转到本地ios文件夹并打开xcode项目。

5)转到文件>项目设置>高级...

6)选择自定义>相对于工作区

7)产品路径应为“构建/构建/产品”

8)中间体路径应为“ build / Build / Intermediates”

9)现在尝试在终端react-native run-ios中运行命令

我希望这种解决方案能够帮助我们中的一些人面对这个问题。

GOTony 2020.03.12

更新React使用react-native upgrade对我有用

免责声明:这将覆盖您的所有iOS配置,请谨慎使用

米亚Harry 2020.03.12

在Xcode中打开项目

如果Xcode> 9 run命令react-native upgrade(这会覆盖您的所有iOS配置,请谨慎使用!)

然后

1.转到文件->项目设置

2.单击高级按钮

3.选择“自定义”,然后在下拉菜单中选择“相对于工作区”

4.将“内部版本/产品”更改为“内部版本/产品/产品”

添加包裹

5.点击完成,完成

阿飞米亚 2020.03.12

如果缺少config.h文件,可能会发生这种情况

对于更新config.h文件,

1)关闭您的Xcode。

2)打开终端,转到项目的根文件夹并执行以下操作:

cd node_modules/react-native/third-party/glog-{X}.{X}.{X}/

3)运行配置脚本:

./configure

4)打开Xcode并尝试运行您的应用程序。

{X}:版本号glog

阳光阿飞 2020.03.12

如果您使用的是Xcode 10,则可能是由于与最新的Xcode构建系统不兼容。尝试切换到旧版构建系统。

打开Xcode 10,“文件”>“项目设置”>“构建系统”>将下拉列表切换到“旧版构建系统”。

屏幕截图

Near飞云 2020.03.12

我的问题实际上是我的构建处于发布模式而不是调试模式。结果,标识符指向了不存在的东西。我更改了构建类型,并最终正常工作。

问题类别

JavaScript Ckeditor Python Webpack TypeScript Vue.js React.js ExpressJS KoaJS CSS Node.js HTML Django 单元测试 PHP Asp.net jQuery Bootstrap IOS Android