菜鸟教程小白 发表于 2022-12-13 15:54:36

ios - 无法解析 manifest.json。 ionic v3 --livereload ios 设备


                                            <p><p>在启用了 --livereload 的 ios 设备上运行我的 ionic 应用程序。关闭应用程序并重新启动时出现以下错误:</p>

<pre><code>Unable to parse manifest.json. Ensure the file is valid JSON   ionic-pro.module.min.js
</code></pre>

<p>这是我目前的环境:</p>

<pre><code>cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils: 1.19.1
    ionic (Ionic CLI) : 3.19.1

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms: ios 4.5.4
    Ionic Framework    : ionic-angular 3.9.2

System:

    ios-deploy : 1.9.2
    ios-sim    : 6.1.2
    Node       : v8.9.3
    npm      : 5.6.0
    OS         : macOS High Sierra
    Xcode      : Xcode 9.2 Build version 9C40b

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro
</code></pre>

<p>配置.xml</p>

<pre><code>&lt;?xml version=&#39;1.0&#39; encoding=&#39;utf-8&#39;?&gt;
&lt;widget id=&#34;com.iecis.sp.portal&#34; version=&#34;0.5.0&#34; xmlns=&#34;http://www.w3.org/ns/widgets&#34; xmlns:cdv=&#34;http://cordova.apache.org/ns/1.0&#34;&gt;
    &lt;name&gt;My App&lt;/name&gt;
    &lt;description&gt;An Ionic App&lt;/description&gt;
    &lt;author email=&#34;[email protected]&#34; href=&#34;https://ionicframework.com&#34;&gt;Ionic Team&lt;/author&gt;
    &lt;content original-src=&#34;index.html&#34; src=&#34;http://192.168.2.94:8100&#34; /&gt;
    &lt;access origin=&#34;*&#34; /&gt;
    &lt;allow-intent href=&#34;http://*/*&#34; /&gt;
    &lt;allow-intent href=&#34;https://*/*&#34; /&gt;
    &lt;allow-intent href=&#34;tel:*&#34; /&gt;
    &lt;allow-intent href=&#34;sms:*&#34; /&gt;
    &lt;allow-intent href=&#34;mailto:*&#34; /&gt;
    &lt;allow-intent href=&#34;geo:*&#34; /&gt;
    &lt;hook src=&#34;hooks/after_build/010_copy_browser_to_docs.js&#34; type=&#34;after_build&#34; /&gt;
    &lt;allow-navigation href=&#34;http://*/*&#34; /&gt;
    &lt;allow-navigation href=&#34;file://*/*&#34; /&gt;
    &lt;allow-navigation href=&#34;*&#34; /&gt;
    &lt;preference name=&#34;android-minSdkVersion&#34; value=&#34;16&#34; /&gt;
    &lt;preference name=&#34;SplashMaintainAspectRatio&#34; value=&#34;true&#34; /&gt;
    &lt;preference name=&#34;AutoHideSplashScreen&#34; value=&#34;true&#34; /&gt;
    &lt;preference name=&#34;FadeSplashScreen&#34; value=&#34;false&#34; /&gt;
    &lt;preference name=&#34;FadeSplashScreenDuration&#34; value=&#34;500&#34; /&gt;
    &lt;preference name=&#34;SplashShowOnlyFirstTime&#34; value=&#34;false&#34; /&gt;
    &lt;preference name=&#34;SplashScreenDelay&#34; value=&#34;3000&#34; /&gt;
    &lt;preference name=&#34;SplashScreen&#34; value=&#34;screen&#34; /&gt;
    &lt;platform name=&#34;android&#34;&gt;
      &lt;icon density=&#34;ldpi&#34; src=&#34;resources/android/icon/drawable-ldpi-icon.png&#34; /&gt;
      &lt;icon density=&#34;mdpi&#34; src=&#34;resources/android/icon/drawable-mdpi-icon.png&#34; /&gt;
      &lt;icon density=&#34;hdpi&#34; src=&#34;resources/android/icon/drawable-hdpi-icon.png&#34; /&gt;
      &lt;icon density=&#34;xhdpi&#34; src=&#34;resources/android/icon/drawable-xhdpi-icon.png&#34; /&gt;
      &lt;icon density=&#34;xxhdpi&#34; src=&#34;resources/android/icon/drawable-xxhdpi-icon.png&#34; /&gt;
      &lt;icon density=&#34;xxxhdpi&#34; src=&#34;resources/android/icon/drawable-xxxhdpi-icon.png&#34; /&gt;
      &lt;splash density=&#34;land-ldpi&#34; src=&#34;resources/android/splash/drawable-land-ldpi-screen.png&#34; /&gt;
      &lt;splash density=&#34;land-mdpi&#34; src=&#34;resources/android/splash/drawable-land-mdpi-screen.png&#34; /&gt;
      &lt;splash density=&#34;land-hdpi&#34; src=&#34;resources/android/splash/drawable-land-hdpi-screen.png&#34; /&gt;
      &lt;splash density=&#34;land-xhdpi&#34; src=&#34;resources/android/splash/drawable-land-xhdpi-screen.png&#34; /&gt;
      &lt;splash density=&#34;land-xxhdpi&#34; src=&#34;resources/android/splash/drawable-land-xxhdpi-screen.png&#34; /&gt;
      &lt;splash density=&#34;land-xxxhdpi&#34; src=&#34;resources/android/splash/drawable-land-xxxhdpi-screen.png&#34; /&gt;
      &lt;splash density=&#34;port-ldpi&#34; src=&#34;resources/android/splash/drawable-port-ldpi-screen.png&#34; /&gt;
      &lt;splash density=&#34;port-mdpi&#34; src=&#34;resources/android/splash/drawable-port-mdpi-screen.png&#34; /&gt;
      &lt;splash density=&#34;port-hdpi&#34; src=&#34;resources/android/splash/drawable-port-hdpi-screen.png&#34; /&gt;
      &lt;splash density=&#34;port-xhdpi&#34; src=&#34;resources/android/splash/drawable-port-xhdpi-screen.png&#34; /&gt;
      &lt;splash density=&#34;port-xxhdpi&#34; src=&#34;resources/android/splash/drawable-port-xxhdpi-screen.png&#34; /&gt;
      &lt;splash density=&#34;port-xxxhdpi&#34; src=&#34;resources/android/splash/drawable-port-xxxhdpi-screen.png&#34; /&gt;
    &lt;/platform&gt;
    &lt;platform name=&#34;ios&#34;&gt;
      &lt;icon height=&#34;57&#34; src=&#34;resources/ios/icon/icon.png&#34; width=&#34;57&#34; /&gt;
      &lt;icon height=&#34;114&#34; src=&#34;resources/ios/icon/[email protected]&#34; width=&#34;114&#34; /&gt;
      &lt;icon height=&#34;40&#34; src=&#34;resources/ios/icon/icon-40.png&#34; width=&#34;40&#34; /&gt;
      &lt;icon height=&#34;80&#34; src=&#34;resources/ios/icon/[email protected]&#34; width=&#34;80&#34; /&gt;
      &lt;icon height=&#34;120&#34; src=&#34;resources/ios/icon/[email protected]&#34; width=&#34;120&#34; /&gt;
      &lt;icon height=&#34;50&#34; src=&#34;resources/ios/icon/icon-50.png&#34; width=&#34;50&#34; /&gt;
      &lt;icon height=&#34;100&#34; src=&#34;resources/ios/icon/[email protected]&#34; width=&#34;100&#34; /&gt;
      &lt;icon height=&#34;60&#34; src=&#34;resources/ios/icon/icon-60.png&#34; width=&#34;60&#34; /&gt;
      &lt;icon height=&#34;120&#34; src=&#34;resources/ios/icon/[email protected]&#34; width=&#34;120&#34; /&gt;
      &lt;icon height=&#34;180&#34; src=&#34;resources/ios/icon/[email protected]&#34; width=&#34;180&#34; /&gt;
      &lt;icon height=&#34;72&#34; src=&#34;resources/ios/icon/icon-72.png&#34; width=&#34;72&#34; /&gt;
      &lt;icon height=&#34;144&#34; src=&#34;resources/ios/icon/[email protected]&#34; width=&#34;144&#34; /&gt;
      &lt;icon height=&#34;76&#34; src=&#34;resources/ios/icon/icon-76.png&#34; width=&#34;76&#34; /&gt;
      &lt;icon height=&#34;152&#34; src=&#34;resources/ios/icon/[email protected]&#34; width=&#34;152&#34; /&gt;
      &lt;icon height=&#34;167&#34; src=&#34;resources/ios/icon/[email protected]&#34; width=&#34;167&#34; /&gt;
      &lt;icon height=&#34;29&#34; src=&#34;resources/ios/icon/icon-small.png&#34; width=&#34;29&#34; /&gt;
      &lt;icon height=&#34;58&#34; src=&#34;resources/ios/icon/[email protected]&#34; width=&#34;58&#34; /&gt;
      &lt;icon height=&#34;87&#34; src=&#34;resources/ios/icon/[email protected]&#34; width=&#34;87&#34; /&gt;
      &lt;icon height=&#34;1024&#34; src=&#34;resources/ios/icon/icon-1024.png&#34; width=&#34;1024&#34; /&gt;
      &lt;splash height=&#34;1136&#34; src=&#34;resources/ios/splash/Default-568h@2x~iphone.png&#34; width=&#34;640&#34; /&gt;
      &lt;splash height=&#34;1334&#34; src=&#34;resources/ios/splash/Default-667h.png&#34; width=&#34;750&#34; /&gt;
      &lt;splash height=&#34;2208&#34; src=&#34;resources/ios/splash/Default-736h.png&#34; width=&#34;1242&#34; /&gt;
      &lt;splash height=&#34;1242&#34; src=&#34;resources/ios/splash/Default-Landscape-736h.png&#34; width=&#34;2208&#34; /&gt;
      &lt;splash height=&#34;1536&#34; src=&#34;resources/ios/splash/Default-Landscape@2x~ipad.png&#34; width=&#34;2048&#34; /&gt;
      &lt;splash height=&#34;2048&#34; src=&#34;resources/ios/splash/Default-Landscape@~ipadpro.png&#34; width=&#34;2732&#34; /&gt;
      &lt;splash height=&#34;768&#34; src=&#34;resources/ios/splash/Default-Landscape~ipad.png&#34; width=&#34;1024&#34; /&gt;
      &lt;splash height=&#34;2048&#34; src=&#34;resources/ios/splash/Default-Portrait@2x~ipad.png&#34; width=&#34;1536&#34; /&gt;
      &lt;splash height=&#34;2732&#34; src=&#34;resources/ios/splash/Default-Portrait@~ipadpro.png&#34; width=&#34;2048&#34; /&gt;
      &lt;splash height=&#34;1024&#34; src=&#34;resources/ios/splash/Default-Portrait~ipad.png&#34; width=&#34;768&#34; /&gt;
      &lt;splash height=&#34;960&#34; src=&#34;resources/ios/splash/Default@2x~iphone.png&#34; width=&#34;640&#34; /&gt;
      &lt;splash height=&#34;480&#34; src=&#34;resources/ios/splash/Default~iphone.png&#34; width=&#34;320&#34; /&gt;
      &lt;splash height=&#34;2732&#34; src=&#34;resources/ios/splash/Default@2x~universal~anyany.png&#34; width=&#34;2732&#34; /&gt;
    &lt;/platform&gt;
    &lt;allow-navigation href=&#34;http://192.168.2.94:8101&#34; /&gt;
    &lt;allow-navigation href=&#34;http://192.168.2.94:8100&#34; /&gt;
    &lt;plugin name=&#34;cordova-plugin-device&#34; spec=&#34;^2.0.1&#34; /&gt;
    &lt;plugin name=&#34;cordova-plugin-file&#34; spec=&#34;^6.0.1&#34; /&gt;
    &lt;plugin name=&#34;cordova-plugin-googlemaps&#34; spec=&#34;^2.1.1&#34;&gt;
      &lt;variable name=&#34;API_KEY_FOR_ANDROID&#34; value=&#34;&lt;android_api_key&gt;&#34; /&gt;
      &lt;variable name=&#34;API_KEY_FOR_IOS&#34; value=&#34;&lt;ios_api_key&gt;&#34; /&gt;
      &lt;variable name=&#34;LOCATION_WHEN_IN_USE_DESCRIPTION&#34; value=&#34;Show your location on the map&#34; /&gt;
      &lt;variable name=&#34;LOCATION_ALWAYS_USAGE_DESCRIPTION&#34; value=&#34;Trace your location on the map&#34; /&gt;
    &lt;/plugin&gt;
    &lt;plugin name=&#34;cordova-plugin-inappbrowser&#34; spec=&#34;^2.0.1&#34; /&gt;
    &lt;plugin name=&#34;com-sarriaroman-photoviewer&#34; spec=&#34;^1.1.11&#34; /&gt;
    &lt;plugin name=&#34;cordova-plugin-splashscreen&#34; spec=&#34;^5.0.1&#34; /&gt;
    &lt;plugin name=&#34;cordova-plugin-statusbar&#34; spec=&#34;^2.4.1&#34; /&gt;
    &lt;plugin name=&#34;cordova-plugin-whitelist&#34; spec=&#34;^1.3.3&#34; /&gt;
    &lt;plugin name=&#34;ionic-plugin-keyboard&#34; spec=&#34;^2.2.1&#34; /&gt;
    &lt;plugin name=&#34;onesignal-cordova-plugin&#34; spec=&#34;^2.2.5&#34; /&gt;
    &lt;plugin name=&#34;cordova-plugin-ionic&#34; spec=&#34;^3.0.0&#34;&gt;
      &lt;variable name=&#34;APP_ID&#34; value=&#34;&lt;app_id&gt;&#34; /&gt;
      &lt;variable name=&#34;CHANNEL_NAME&#34; value=&#34;Master&#34; /&gt;
      &lt;variable name=&#34;UPDATE_API&#34; value=&#34;https://api.ionicjs.com&#34; /&gt;
      &lt;variable name=&#34;UPDATE_METHOD&#34; value=&#34;background&#34; /&gt;
      &lt;variable name=&#34;MAX_STORE&#34; value=&#34;2&#34; /&gt;
    &lt;/plugin&gt;
    &lt;plugin name=&#34;cordova-plugin-background-mode&#34; spec=&#34;^0.7.2&#34; /&gt;
&lt;/widget&gt;
</code></pre>

<p>Ionic Cordova 插件:</p>

<pre><code>com-sarriaroman-photoviewer 1.1.11 &#34;PhotoViewer&#34;
com.googlemaps.ios 2.5.0 &#34;Google Maps SDK for iOS&#34;
cordova-plugin-add-swift-support 1.7.1 &#34;AddSwiftSupport&#34;
cordova-plugin-background-mode 0.7.2 &#34;BackgroundMode&#34;
cordova-plugin-device 2.0.1 &#34;Device&#34;
cordova-plugin-file 6.0.1 &#34;File&#34;
cordova-plugin-googlemaps 2.1.1 &#34;cordova-plugin-googlemaps&#34;
cordova-plugin-inappbrowser 2.0.1 &#34;InAppBrowser&#34;
cordova-plugin-ionic 3.0.0 &#34;IonicCordova&#34;
cordova-plugin-splashscreen 5.0.1 &#34;Splashscreen&#34;
cordova-plugin-statusbar 2.4.1 &#34;StatusBar&#34;
cordova-plugin-whitelist 1.3.3 &#34;Whitelist&#34;
ionic-plugin-keyboard 2.2.1 &#34;Keyboard&#34;
onesignal-cordova-plugin 2.2.5 &#34;OneSignal Push Notifications&#34;
</code></pre>

<p>两个问题:</p>

<ol>
<li>为什么会出现此错误?</li>
<li>从哪里开始调试?</li>
</ol>

<p>任何帮助/建议/轻推将不胜感激。如果您需要更多信息,请告诉我。</p>

<p>更新:</p>

<p>manifest.json</p>

<pre><code>{
&#34;name&#34;: &#34;Ionic&#34;,
&#34;short_name&#34;: &#34;Ionic&#34;,
&#34;start_url&#34;: &#34;index.html&#34;,
&#34;display&#34;: &#34;standalone&#34;,
&#34;icons&#34;: [{
    &#34;src&#34;: &#34;assets/imgs/logo.png&#34;,
    &#34;sizes&#34;: &#34;512x512&#34;,
    &#34;type&#34;: &#34;image/png&#34;
}],
&#34;background_color&#34;: &#34;#4e8ef7&#34;,
&#34;theme_color&#34;: &#34;#4e8ef7&#34;
}
</code></pre></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>我已经解决了这个问题。
安装插件:
<code>ionic cordova 插件添加 cordova-plugin-ionic-webview --save</code>
并更新 <code>config.xml</code>:</p>

<pre><code>&lt;allow-navigation href=&#34;http://localhost:8080/*&#34;/&gt;
&lt;feature name=&#34;CDVWKWebViewEngine&#34;&gt;
&lt;param name=&#34;ios-package&#34; value=&#34;CDVWKWebViewEngine&#34; /&gt;
&lt;/feature&gt;

&lt;preference name=&#34;CordovaWebViewEngine&#34; value=&#34;CDVWKWebViewEngine&#34; /&gt;
</code></pre>

<p>您可以关注 <a href="https://ionicframework.com/docs/wkwebview/" rel="noreferrer noopener nofollow">this guide</a>来自 ionic 文档:</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 无法解析 manifest.json。 ionic v3 --livereload ios 设备,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/48502862/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/48502862/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 无法解析 manifest.json。 ionic v3 --livereload ios 设备