首页 文章

无法获取初始的React Native App来运行

提问于
浏览
1

描述

根据基本教程,我无法运行最初的React Native应用程序 . 该错误似乎与UIUserInterfaceIdiomCarPlay有关 .

复制步骤和示例代码

按照这里的教程https://facebook.github.io/react-native/releases/0.23/docs/tutorial.html#content

我创建了一个新的React Native项目 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.

附加信息

React Native版本:0.42.3

平台:iOS

开发操作系统:MacOS

开发工具:Xcode,命令行

1 回答

  • 0

    Someone最近遇到了与该错误消息 Use of undeclared identifier 'UIUserInterfaceIdiomCarPlay'; did you mean 'UIUserInterfaceIdiomPad'? 相同的问题 . 他评论了 node_modules/react-native/React/Base/RCTPlatform.m 中的第26和27行,显然是让它起作用了 . 它可能与使用过时版本的Xcode有关

相关问题