菜鸟教程小白 发表于 2022-12-11 17:02:12

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


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

<p>加载的页面(白屏)如下所示:</p>

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

&lt;link ios-href=&#34;build/css/app.ios.css&#34; rel=&#34;stylesheet&#34;&gt;
&lt;link md-href=&#34;build/css/app.md.css&#34; rel=&#34;stylesheet&#34;&gt;
&lt;link wp-href=&#34;build/css/app.wp.css&#34; rel=&#34;stylesheet&#34;&gt;
&lt;/head&gt;
&lt;body class=&#34;platform-ios platform-cordova platform-webview&#34;&gt;

&lt;!-- this Ionic&#39;s root component and where the app will load --&gt;
&lt;ion-app&gt;&lt;/ion-app&gt;

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

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

<p>有没有人遇到过类似的问题?</p>

<p>我的版本信息如下:</p>

<ul>
<li> CordovaCLI:6.2.0 </li>
<li>Ionic 框架版本:2.0.0-beta.7 </li>
<li>Ionic CLI 版本:2.0.0-beta.25 </li>
<li>Ionic App Lib 版本:2.0.0-beta.15</li>
<li>ios-deploy 版本:1.8.6 </li>
<li>ios-sim 版本:5.0.8 </li>
<li>操作系统:Mac OS X El Capitan </li>
<li>节点版本:v6.2.0 </li>
<li>Xcode 版本:Xcode 7.3.1 Build 版本 7D1014 </li>
<li>iPad mini 2 和 iPhone 6 iOS 版本:9.3.3</li>
</ul></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>我先放在这里,突然有人派上用场了。</p>

<hr/>

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

<hr/>

<blockquote>
<p>For completeness, better run applications in production environments.<br/>
They are generally more informative than emulators.</p>
</blockquote></p>
                                   
                                                <p style="font-size: 20px;">关于ios - Ionic 2 App 在浏览器和 Android 上加载,但在 iOS 上不加载,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/38490392/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/38490392/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - Ionic 2 App 在浏览器和 Android 上加载,但在 iOS 上不加载