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

当我运行react-native run-ios的构build成功,但我得到下面的错误。 我已经检查了所有的地方,但似乎没有工作。 在命令前面使用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) 

使用react-native upgrade更新反应并覆盖所有iOS文件。 这是为我做的。

在XCode中打开项目

如果Xcode> 9运行命令react-native upgrade

然后

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

2.单击高级button

3.select“Custom”并在下拉菜单中select“Relative to Workspace”

4.将“Build / Products”更改为“Build / Build / Products”

添加包

5.点击完成,完成

我的问题实际上是我的版本是在发布模式,而不是debugging模式。 结果,标识符指向了一些不存在的东西。 我改变了构buildtypes,它结束了工作。

当我的node_modules文件夹在安装一个新的软件包后变得棘手的时候,我遇到了这种情况。 我杀了文件夹rm -rf node_modules然后做了一个npm install重新安装我的软件包,并修复它。

如果您收到此错误,那么您的应用程序可能没有正确的path。

处理该命令时遇到错误(domain = NSPOSIXErrorDomain,code = 2):未能安装所请求的应用程序在提供的path中找不到应用程序束。 提供所需应用程序包的有效path。 打印:条目“:CFBundleIdentifier”不存在

React Native已经将它硬编码为runIOS.js中run-ios命令的一部分

 build/Build/Products/${configuration}-${isDevice ? 'iphoneos' : 'iphonesimulator'}/${appName}.app 

不幸的是,Xcode具有不同的构buildpath,具体取决于您的configuration以及是否使用Xcode项目或Workspace。 我相信Xcode项目的默认path是build/Products
我提交了这个拉请求11899 ,给CLI程序员更多的灵活性。

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

我也遇到了这个问题,我find了解决的办法

这是我做的:

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

2)cd 项目目录

3)运行命令react-native升级

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

5)进入文件>项目设置>高级…

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

7)产品path应该是“构build/构build/产品”

8)中间体path应该是“构build/构build/中间体”

9)现在尝试在terminalreact-native run-ios中运行命令

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

你有没有检查你声明了一个包标识符? 您可以通过点击xcode中的项目文件然后select常规选项卡并在“身份”下的第一个文本框下列出。 另一种检查方法是检查您的项目的ios文件夹中的info.plist文件。 这是如何显示在我的info.plist。 我的项目的实际捆绑包标识符是xcode。

 <key>CFBundleIdentifier</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> 

我更新了Xcode到V8和错误已解决。

这个工作对我来说在导航器中单击RCTWebSocket项目,并删除生成设置>自定义编译器标志下的标志 在这里输入图像说明

我发现如何解决这个问题:不要在你的项目path中使用空间! 🎉😄

我的terminalpopup相同的消息,因为删除了一些我在Xcode中不使用的模拟器。

如果你运行了没有特定参数的react-native run-ios ,react-native会运行默认的模拟器,在我的情况下,它是使用iOS 10.3.1的iPhone 6,我偶然删除了这个模拟器。

这里是我的错误消息:

 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并检查可用的模拟器(与列出的terminal相同),并运行react-native run-ios --simulator="your device name"

对于我的情况,我运行react-native run-ios --simulator="iPhone 7" ,问题解决了。

MAC解决scheme面对这个问题与反应本地版本0.45.1

经过许多解决scheme,这是我编译它

  1. 首先最重要的一步是确保您的Mac上运行最新的Xcode版本。

  2. 检查您的项目名称是否包含空格。 如果它很好地删除空格。

  3. 包括我在内的许多用户发现这个问题是由于react-native 0.45.1的最新发布版本,所以如果你使用这个版本,你可以使用下面的步骤降级到更稳定的版本(即0.44.0

    检查您当前的反应原生版本types

    react-native -v

    3.1如果你有你的项目创build。

     Go to your current Project directory through terminal and type 

    npm install react-native-git-upgrade(如果已安装,请跳过此步骤)

    react-native-git-upgrade 0.44.0

    降级到这个版本解决了我的问题。

    3.2如果您即将创build一个新项目,请尝试使用下面的行

    react-native init ProjectName -v 0.44.0

    用项目名称replaceProjectName。

    安装后,检查当前版本的react-native和安装时指定的版本是否匹配。 如果没有,那么在项目创build后尝试步骤3.1。

如果仍然存在相同的问题,请在下面评论,以便我可以尝试find更多的解决方法。

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

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

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

当你运行npm install命令的时候出现internet问题, node_modules\react-native\third-party中的文件没有正确下载,请检查一下是否正确下载,否则请删除node_modules并重新安装

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