执行 react-native run-ios后遇到以下错误:
Users/{user}/js/elm-react-native/node_modules/react-native/React/Base/RCTPlatform.m:26:10: error: use of undeclared identifier 'UIUserInterfaceIdiomCarPlay'; did you mean 'UIUserInterfaceIdiomPad'?
case UIUserInterfaceIdiomCarPlay:
^~~~~~~
UIUserInterfaceIdiomPad
In module 'UIKit' imported from /Users/louis/js/elm-react-native/node_modules/react-native/React/Base/RCTPlatform.m:12:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDevice.h:33:5: note: 'UIUserInterfaceIdiomPad' declared here
UIUserInterfaceIdiomPad NS_ENUM_AVAILABLE_IOS(3_2), // iPad style UI
^
/Users/louis/js/elm-react-native/node_modules/react-native/React/Base/RCTPlatform.m:26:10: error: duplicate case value 'UIUserInterfaceIdiomPad'
case UIUserInterfaceIdiomCarPlay:
^
/Users/louis/js/elm-react-native/node_modules/react-native/React/Base/RCTPlatform.m:22:10: note: previous case defined here
case UIUserInterfaceIdiomPad:
^
2 errors generated.
BUILD FAILED
The following build commands failed:
CompileC /Users/louis/js/elm-react-native/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Objects-normal/x86_64/RCTPlatform.o Base/RCTPlatform.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/Elm.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/Elm.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
执行 react-native run-ios后遇到以下错误: Users/{user}/js/elm-react-native/node_modules/react-native/React/Base/RCTPlatform.m:26:10: error: use of undeclared identifier 'UIUserInterfaceIdiomCarPlay'; did you mean 'UIUserInterfaceIdiomPad'? case UIUserInterfaceIdiomCarPlay: ^
~~~~~~ UIUserInterfaceIdiomPad In module 'UIKit' imported from /Users/louis/js/elm-react-native/node_modules/react-native/React/Base/RCTPlatform.m:12: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDevice.h:33:5: note: 'UIUserInterfaceIdiomPad' declared here UIUserInterfaceIdiomPad NS_ENUM_AVAILABLE_IOS(3_2), // iPad style UI ^ /Users/louis/js/elm-react-native/node_modules/react-native/React/Base/RCTPlatform.m:26:10: error: duplicate case value 'UIUserInterfaceIdiomPad' case UIUserInterfaceIdiomCarPlay: ^ /Users/louis/js/elm-react-native/node_modules/react-native/React/Base/RCTPlatform.m:22:10: note: previous case defined here case UIUserInterfaceIdiomPad: ^ 2 errors generated.BUILD FAILED
The following build commands failed:
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/Elm.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/Elm.app/Info.plist Print: Entry, ":CFBundleIdentifier", Does Not Exist