我几乎尝试了所有的解决方案,但似乎没有一种解决方案。
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",不存在
如何让项目运行?
答案 0 :(得分:1)
由于我删除了一些我不会在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并检查可用的模拟器(与列出的终端相同)并运行react-native run-ios --simulator="your device name"
对于我的情况,我运行react-native run-ios --simulator="iPhone 7"
,问题解决了。
答案 1 :(得分:0)
对我有用的是在xcode中打开项目并在那里运行项目。 Xcode对我来说有一些问题。第一个问题是我选择了错误的设备进行测试。
我确保选择了iPhone X模拟器(由于某种原因,它默认设置为未设置为开发设备的ipad)。
然后确保在运行时没有红色警告。我还有一个红色警告,那是因为我没有选择项目的团队资料。
我还将捆绑包标识符更改为我的公司名称,以使其唯一。
在xcode中运行它是了解错误的最佳方法。不要单靠反应本机来找出错误。
答案 2 :(得分:-1)
当我删除~/.rncash
本机信息
React Native Environment Info:
System:
OS: macOS 10.14.1
CPU: x64 Intel(R) Core(TM) i5-4258U CPU @ 2.40GHz
Memory: 78.15 MB / 8.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 8.11.3 - /usr/local/bin/node
Yarn: 1.9.4 - /usr/local/bin/yarn
npm: 6.3.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
IDEs:
Android Studio: 3.2 AI-181.5540.7.32.5056338
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.0-alpha.8af6728 => 16.6.0-alpha.8af6728
react-native: 0.57.4 => 0.57.4
npmGlobalPackages:
create-react-native-app: 1.0.0
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7