无法为react-native app构建发行版(bundle error)

时间:2018-06-18 17:07:41

标签: ios xcode react-native

出于某种原因,我在通过react-native构建我的应用程序的发行版时遇到以下错误。

  

***由于未捕获的异常终止应用程序' RCTFatalException:未处理的JS异常:t.typeof不是函数。 (&#t; typeof(" function" == typeof Symbol?Symbol.iterator:" @@ iterator")',' t.typeof& #39;未定义)(/Users /../THEAPP.app/main.jsbundle:11)' ;, reason:' Unhandled JS Exception:t.typeof不是函数。 (&#t; typeof("功能......'

我的目标是在使用捆绑包时将应用程序放到手机上。

我尝试了以下内容:

  1. 通过将Scheme编辑为Release bundle来创建bundle
  2. 使用以下内容自行导出捆绑包:react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios
  3. 我对这两个错误都有同样的错误。当然,这是在我将 AppDelegate.m 更改为以下内容之后:

    //jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
    jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
    

    有谁知道为什么会发生这种情况?我正在使用Xcode 9.4

0 个答案:

没有答案
相关问题