react-native UIExplorer不会在iOS模拟器中运行? (红色框“未提供脚本URL”)

时间:2016-05-23 16:24:04

标签: react-native

使用Xcode 7.3,我在iOS模拟器上运行“没有提供脚本URL”?

我关注UIExplorer README.md

git clone https://github.com/facebook/react-native.git
cd react-native
npm install
Open Examples/UIExplorer/UIExplorer.xcodeproj in Xcode
Hit the Run button

react-native UIExplorer red-box "No script URL provided"

通常在iOS模拟器上运行运行良好。我错过了什么?

我的目标是评估UIExplorer中的NavigatorExperimental,以便在iOS和Android上使用。

其他例子如/ Examples / Movies /运行良好。

提前致谢,

1 个答案:

答案 0 :(得分:0)

最近的这一变化打破了UIExplorer的运行:

https://github.com/facebook/react-native/commit/913b4ccee492780ae180657094c261805455deea

解决方法是在AppDelegate.m中注释掉以下行。

注释会阻止它设置sourceURL = nil

// if (!getenv("CI_USE_PACKAGER")) {
// sourceURL = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
// }

电影示例正常。电影示例没有此行检查CI_USE_PACKAGER环境变量。