react-native – 打印:条目,“:CFBundleIdentifier”,不存在已尝试过大多数解决方案

我已经尝试了所有的解决方案,但它们似乎都没有.

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/albums.app/Info.plis

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

你如何让项目运行?

解决方法

由于删除了一些我在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,name:iPad Pro (10.5-inch) }
    { platform:iOS Simulator,id:991C8B5F-49E2-4BB7-BBB6-2F5D1776F8D2,name:iPad Pro (12.9 inch) }
    { platform:iOS Simulator,id:B9A80D04-E43F-43E3-9CA5-21137F7C673D,name:iPhone 7 }
    { platform:iOS Simulator,id:58F6514E-185B-4B12-9336-B8A1D4E901F8,name:iPhone 7 Plus }

. . .

Installing build/Build/Products/Debug-iphonesimulator/myapp.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain,Does Not Exist

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

为了摆脱这些,打开你的Xcode并检查可用的模拟器(与列出的终端相同)并运行react-native run-ios –simulator =“你的设备名称”

对于我的情况,我运行react-native run-ios –simulator =“iPhone 7”,问题解决了.

相关文章

react 中的高阶组件主要是对于 hooks 之前的类组件来说的,如...
我们上一节了解了组件的更新机制,但是只是停留在表层上,例...
我们上一节了解了 react 的虚拟 dom 的格式,如何把虚拟 dom...
react 本身提供了克隆组件的方法,但是平时开发中可能很少使...
mobx 是一个简单可扩展的状态管理库,中文官网链接。小编在接...
我们在平常的开发中不可避免的会有很多列表渲染逻辑,在 pc ...