ios - Ionic 2 App 在浏览器和 Android 上加载,但在 iOS 上不加载

标签 ios cordova ionic2

我的团队最近将我们支持的平台扩展到 iOS,但我仍然无法让它在任何 iOS 设备上运行。使用“ionic serve”和“ionic run android”效果很好,一切都按预期进行。但是当使用“ionic run ios”时,应用程序加载并进入经典的死机白屏。没有记录错误,也没有显示任何内容。

加载的页面(白屏)如下所示:

<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<title>Ionic</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">

<link ios-href="build/css/app.ios.css" rel="stylesheet">
<link md-href="build/css/app.md.css" rel="stylesheet">
<link wp-href="build/css/app.wp.css" rel="stylesheet">  
</head>
<body class="platform-ios platform-cordova platform-webview">

<!-- this Ionic's root component and where the app will load -->
<ion-app></ion-app>

<!-- cordova.js required for cordova apps -->
<script src="cordova.js"></script>
<!-- Polyfill needed for platforms without Promise and Collection support -->
<script src="build/js/es6-shim.min.js"></script>
<!-- Zone.js and Reflect-metadata  -->
<script src="build/js/Reflect.js"></script>
<script src="build/js/zone.js"></script>
<!-- the bundle which is built from the app's source code -->
<script src="build/js/app.bundle.js"></script>
</body>
</html>

我尝试使用相同的命令和方法加载基本的入门级 Ionic 2 应用程序,结果成功了,并且页面中包含内容。通过使用一些 console.logs 之类的东西,我发现代码从不加载 app.ts 文件,所以这可以解释为什么它永远不会到达主页,但由于没有记录错误,我什至不知道在哪里看在修复任何东西。我想知道 app.bundle.js 是否有问题,但我真的不知道从哪里开始。

有没有人遇到过类似的问题?

我的版本信息如下:

  • Cordova CLI:6.2.0
  • Ionic 框架版本:2.0.0-beta.7
  • Ionic CLI 版本:2.0.0-beta.25
  • Ionic 应用程序库版本:2.0.0-beta.15
  • ios部署版本:1.8.6
  • ios-sim 版本:5.0.8
  • 操作系统:Mac OS X El Capitan
  • 节点版本:v6.2.0
  • Xcode 版本:Xcode 7.3.1 构建版本 7D1014
  • iPad mini 2 和 iPhone 6 iOS 版本:9.3.3

最佳答案

先放在这里吧,突然有人派上用场了。


It is necessary to correct the errors in the console is running ionic serve.
Otherwise, just do not compile the necessary file app/www/build/js/app.bundle.js


For completeness, better run applications in production environments.
They are generally more informative than emulators.

关于ios - Ionic 2 App 在浏览器和 Android 上加载,但在 iOS 上不加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38490392/

相关文章:

ios - UIPageViewController的setViewControllers方法的动画时长是多少

android - $cordovaFile checkFile() 查看 www 文件夹中的文件是否存在?

angular - Ionic2:在ion-segment内使用chartjs

angular - Ionic 2 - 同时有多个菜单(右 - 左)

ios - iOS 中的多个 UIAlertController

ios - Swift3版本用于emojilesslessStringWithSubstitution

android - map 上不需要的灰色区域

html - 如何在 phonegap 中引用样式表?

angular - InjectionToken 产生 "Error encountered resolving symbol values statically"

ios - 我可以使用 XCode 中的 Settings Bundle 编辑器指定除“Settings”之外的 UI吗?