ionic 1,应用程序无法在iOS 9.3中启动,白屏

问题描述:

>ionic info

Node       : v6.7.0
OS         : macOS Sierra
Xcode      : Xcode 8.3.3 Build version 8E3004b 
ios-deploy : 1.9.1 
ios-sim    : 6.0.0 
npm        : 5.0.1 
@ionic/cli-utils : 1.4.0
Cordova CLI      : 7.0.1 
Gulp CLI         : CLI version 3.9.1 Local version 3.9.1
Ionic CLI        : 3.4.0
@ionic/cli-plugin-cordova : 1.4.0
@ionic/cli-plugin-gulp    : 1.0.1
@ionic/cli-plugin-ionic1  : 2.0.0
Cordova Platforms         : android 6.0.0 ios 4.3.0
Ionic Framework           : unknown

>ionic cordova platform list

android 6.0.0
ios 4.3.0

App对于带有ios 10.3.x的模拟器正常工作 但是在ios 9.3上运行时,它会在该白色空白页之后短暂显示启动屏幕.调试窗口上没有错误消息,我看到cordova ready和fcm以及其他插件就绪消息,但是应用程序源代码中没有任何消息...

App works normal for simulators with ios 10.3.x but when run on ios 9.3, it briefly shows splashscreen after that white blank page. There is no error messages on debug window, I see cordova ready and fcm and other plugin ready messages, but nothing from app source code...

  • whitelist插件尝试了不同的设置,认为它可能阻塞了线程,没有运气
  • 尝试删除平台并添加了不同的cordova platform add ios@x版本,没有运气
  • 在脚本中具有console.log,但是它们不会启动或显示,也没有运气(也许某些东西不允许加载它们,但它适用于ios 10.x版本)
  • tried to different settings for whitelist plugin thought it might be blocking thread, no luck
  • tried removing platform and added different cordova platform add ios@x versions, no luck
  • have console.log in scripts, but they won't start or show up, no luck (maybe something is not allowing them to be loaded, but it works ios 10.x versions)

如果有人遇到或解决了白屏问题,请发表评论并分享您的解决方案,我相信这会在以后帮助很多人,尤其是我,最近几天尝试了每种组合,我能想到的却没什么帮助.

If anyone had or fixed white screen issue, please comment and share your solution, I am sure it would help a lot of people in future and especially me, for last few days tried every combinations, I can think of but nothing seem to help.

为了将来,像我这样的麻烦制造者:)

For future, trouble makers, like myself :)

上述问题可能是由于JS不兼容或缺少模块依赖性等引起的.

Above issue might be because of JS incompatibility or missing module dependencies, etc.

经过长时间的尝试,我最终发现了一个错误,即在将所有其他脚本注入index.html文件中的<head>内部之前,添加了以下内容.

After many long hours of tries, I ended up finding a bug by adding following before injecting all other scripts inside <head> in index.html file.

<script type="text/javascript">
    window.onerror = function (errorMsg, url, lineNumber) {
      alert('Error: ' + errorMsg + ' Script: ' + url + ' Line: ' + lineNumber);
    }
</script>