2017-04-01 70 views
1

說明無法獲得初始React本機應用程序運行

我無法獲得初始React Native應用程序以運行基本教程。該錯誤似乎與UIUserInterfaceIdiomCarPlay有關。

再生產步驟和示例代碼

繼教程這裏https://facebook.github.io/react-native/releases/0.23/docs/tutorial.html#content

我創建了一個新的陣營本地項目react-native init AwesomeProject 然後進入該目錄,並運行react-native run-ios

注意我也是從Xcode的嘗試,以及無數的網上修復,但仍然沒有骰子。這是我得到的錯誤:

/Users/lauracressman/Desktop/AwesomeProject/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/lauracressman/Desktop/AwesomeProject/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/lauracressman/Desktop/AwesomeProject/node_modules/react-native/React/Base/RCTPlatform.m:26:10: error: duplicate case value 'UIUserInterfaceIdiomPad' case UIUserInterfaceIdiomCarPlay: ^ /Users/lauracressman/Desktop/AwesomeProject/node_modules/react-native/React/Base/RCTPlatform.m:22:10: note: previous case defined here case UIUserInterfaceIdiomPad: ^ 2 errors generated.

其他信息

陣營原生版本:0.42.3

平臺:iOS的

開發操作系統:MacOS的

開發工具:Xcode,命令行

+0

您運行的是哪個版本的Xcode? –

+0

將Xcode更新至版本8.1或更高版本 – Hariks

回答

0

Someone最近面臨着與該錯誤消息Use of undeclared identifier 'UIUserInterfaceIdiomCarPlay'; did you mean 'UIUserInterfaceIdiomPad'?相同的問題。他評論說,從node_modules/react-native/React/Base/RCTPlatform.m行26 & 27並顯然得到它的工作。它可能與使用過時版本的Xcode有關