React native run iOS build failed error: Multiple commands produceEntry, ":CFBundleIdentifier", Does Not Exist

React native run iOS build failed error: Multiple commands produceEntry, ":CFBundleIdentifier", Does Not Exist

安装react native项目依赖并执行react-native link后,当我运行命令react-native run-ios.

时出现这个错误
    Build system information

    error: Multiple commands produce ...
    1) Target 'ReactNativeNavigation' (project 'ReactNativeNavigation') has copy command from '.../node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.h' to '.../ios/build/Build/Products/Debug-iphonesimulator/include/ReactNativeNavigation/ReactNativeNavigation.h'
    2) Target 'ReactNativeNavigation' (project 'ReactNativeNavigation') has copy command from '.../node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.h' to '.../ios/build/Build/Products/Debug-iphonesimulator/include/ReactNativeNavigation/ReactNativeNavigation.h'

    ** BUILD FAILED **

    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

提供更多信息:

react-native-cli: 2.0.1
react-native: 0.56.0
xcode 10.0
node v10.11.0
npm 6.4.1

谢谢

这是 react-native-navigation 错误并已在 this commit

中修复

一个临时的解决办法是在你的项目 hirerchy 中转到 ReactNativeNavigation.xcodeproj(应该在 Libraries 下),然后在 TARGETS 下选择 ReactNativeNavigation(并且不是 PROJECT),然后是 select Build Phases > Copy files,然后检查 Copy only when installing.