ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
51.03k stars 13.51k forks source link

Failed to load cordova.js and menifest.json on ios #14438

Closed azakusilo closed 5 years ago

azakusilo commented 6 years ago

Ionic version: (check one with "x") [x] 4.x

I'm submitting a ... (check one with "x") [x] bug report [ ] feature request

insert the output from ionic info here
@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

global packages:

cordova (Cordova CLI) : 8.0.0

local packages:

@ionic/app-scripts : 3.1.9
Cordova Platforms  : android 6.3.0 ios 4.5.4
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.1.1
Node              : v6.11.4
npm               : 4.4.4
OS                : Windows 8.1

Environment Variables:

ANDROID_HOME : D:\AndroidSDK2

Misc:

backend : pro

Hello. I'm compile app from your service for ios android. This android i got no problems, but with ios I occurs a error:

[Error] Unable to parse manifest.json. Ensure the file is valid JSON
(анонимная функция) (vendor.js:146429:29717)
run (polyfills.js:3:10150)
(анонимная функция) (polyfills.js:3:20246)
runTask (polyfills.js:3:10845)
o (polyfills.js:3:7902)
invokeTask (polyfills.js:3:16825)
p (polyfills.js:2:27655)
v (polyfills.js:2:27895)
[Error] Object
response: {name: "Ionic", short_name: "Ionic", start_url: "index.html", display: "standalone", icons: [{src: "assets/imgs/logo.png", sizes: "512x512", type: "image/png"}], …}

status: 0

Прототип Object

(анонимная функция) (vendor.js:146429:29795)
run (polyfills.js:3:10150)
(анонимная функция) (polyfills.js:3:20246)
runTask (polyfills.js:3:10845)
o (polyfills.js:3:7902)
invokeTask (polyfills.js:3:16825)
p (polyfills.js:2:27655)
v (polyfills.js:2:27895)
[Error] Unhandled Promise rejection: (8)
{status: 0, response: Object}
"; Zone:"
"<root>"
"; Task:"
"Promise.then"
"; Value:"
{status: 0, response: Object}
undefined
onUnhandledError (polyfills.js:3:20729)
r (polyfills.js:3:18976)
(анонимная функция) (polyfills.js:3:21056)
microtaskDrainDone (polyfills.js:3:21061)
o (polyfills.js:3:8009)
invokeTask (polyfills.js:3:16825)
p (polyfills.js:2:27655)
v (polyfills.js:2:27895)
[Error] the cordova-plugin-ionic plugin is not installed. Install it for better device information for runtime errors.
(анонимная функция) (vendor.js:146430:242)
t (polyfills.js:3:21508)
queryDeviceInfo (vendor.js:146429:31898)
finishLoad (vendor.js:146429:30799)
(анонимная функция) (vendor.js:146429:30908)
runTask (polyfills.js:3:10845)
invokeTask (polyfills.js:3:16802)
n (polyfills.js:3)

and


Path to cordova on device [Error] Failed to load resource: The requested URL was not found on this server. (cordova.js, line 0)


What it can be? Please help. In first start app see cordove.js. After second no. Why?

My manifest.json

{
  "name": "Ionic",
  "short_name": "Ionic",
  "start_url": "index.html",
  "display": "standalone",
  "icons": [{
    "src": "assets/imgs/logo.png",
    "sizes": "512x512",
    "type": "image/png"
  }],
  "background_color": "#4e8ef7",
  "theme_color": "#4e8ef7"
}

config.xml

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.readyscript.mobilesiteapp" version="0.0.14" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>RSMobile</name>
    <description>Mobile site on your device</description>
    <author email="support@readyscript.ru" href="http://readyscript.ru">ReadyScript lab.</author>
    <content src="index.html" />
    <access origin="*" />
    <allow-navigation href="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="android">
        <allow-intent href="market:*" />
        <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
        <splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
        <splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
        <splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
        <splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
        <splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
        <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
        <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
        <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
        <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
        <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
        <splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
        <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
        <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
        <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
        <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
        <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
        <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <icon height="57" src="resources/ios/icon/icon.png" width="57" />
        <icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
        <icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
        <icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
        <icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" />
        <icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
        <icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" />
        <icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
        <icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" />
        <icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" />
        <icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
        <icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" />
        <icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
        <icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" />
        <icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" />
        <icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
        <icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
        <icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
        <icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" />
        <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
        <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
        <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
        <splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
        <splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
        <splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732" />
        <splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
        <splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
        <splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" />
        <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
        <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
        <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
        <splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
    </platform>
    <preference name="webviewbounce" value="false" />
    <preference name="UIWebViewBounce" value="false" />
    <preference name="DisallowOverscroll" value="true" />
    <preference name="ScrollEnabled" value="false" />
    <preference name="BackupWebStorage" value="none" />
    <preference name="android-minSdkVersion" value="19" />
    <preference name="BackupWebStorage" value="none" />
    <preference name="SplashMaintainAspectRatio" value="true" />
    <preference name="FadeSplashScreenDuration" value="300" />
    <preference name="SplashShowOnlyFirstTime" value="false" />
    <preference name="SplashScreen" value="screen" />
    <preference name="ShowSplashScreenSpinner" value="false" />
    <preference name="AutoHideSplashScreen" value="false" />
    <preference name="SplashScreenDelay" value="3000" />
    <preference name="loadUrlTimeoutValue" value="700000" />
    <preference name="AndroidPersistentFileLocation" value="Compatibility" />
    <feature name="StatusBar">
        <param name="ios-package" onload="true" value="CDVStatusBar" />
    </feature>
    <feature name="InAppBrowser">
        <param name="ios-package" value="CDVInAppBrowser" />
        <param name="android-package" value="org.apache.cordova.inappbrowser.InAppBrowser" />
    </feature>
    <allow-navigation href="http://192.168.1.199:8100" />
    <plugin name="cordova-plugin-console" spec="^1.1.0" />
    <plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
    <plugin name="cordova-plugin-device" spec="^2.0.2" />
    <plugin name="es6-promise-plugin" spec="^4.2.2" />
    <plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
    <plugin name="cordova-plugin-screen-orientation" spec="^2.0.2" />
    <plugin name="cordova-plugin-network-information" spec="^2.0.1" />
    <plugin name="cordova-plugin-inappbrowser" spec="^3.0.0" />
    <plugin name="cordova-plugin-splashscreen" spec="^5.0.2" />
    <plugin name="cordova-plugin-compat" spec="^1.2.0" />
    <plugin name="cordova-plugin-geolocation" spec="^4.0.1">
        <variable name="GEOLOCATION_USAGE_DESCRIPTION" value="Text" />
    </plugin>
    <plugin name="call-number" spec="^1.0.1" />
    <plugin name="cordova-plugin-google-analytics" spec="^1.8.3" />
    <plugin name="cordova-plugin-app-version" spec="^0.1.9" />
    <plugin name="cordova-plugin-statusbar" spec="2.4.2" />
    <plugin name="cordova-plugin-file" spec="^6.0.1" />
    <plugin name="cordova-plugin-advanced-http" spec="^1.10.1" />
    <plugin name="phonegap-plugin-push" spec="^1.10.6">
        <variable name="SENDER_ID" value="-------------" />
    </plugin>
    <plugin name="cordova-plugin-ionic" spec="^4.1.7">
        <variable name="APP_ID" value="------" />
        <variable name="CHANNEL_NAME" value="Master" />
        <variable name="UPDATE_METHOD" value="background" />
        <variable name="MAX_STORE" value="2" />
        <variable name="WARN_DEBUG" value="true" />
        <variable name="UPDATE_API" value="https://api.ionicjs.com" />
    </plugin>
    <engine name="android" spec="~6.3.0" />
    <engine name="ios" spec="~4.5.4" />
</widget>

index.html

<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
    <meta charset="UTF-8">
    <title>MobileSiteApp</title>
    <meta name="viewport" content="viewport-fit=cover, 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 rel="icon" type="image/x-icon" href="assets/icon/favicon.ico">
    <link rel="manifest" href="manifest.json">
    <meta name="theme-color" content="#4e8ef7">

    <!-- add to homescreen for ios -->
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <!-- cordova.js required for cordova apps-->
    <script src="cordova.js" type="text/javascript"></script>

    <!-- un-comment this code to enable service worker
    <script>
    if ('serviceWorker' in navigator) {
      navigator.serviceWorker.register('service-worker.js')
        .then(() => console.log('service worker installed'))
        .catch(err => console.log('Error', err));
    }
    </script>-->

    <link href="build/main.css" rel="stylesheet"/>

    <script src="assets/js/rs.init.js" type="text/javascript"></script>
    <script src="assets/js/LAB.js" type="text/javascript"></script>
    <script type="text/javascript">
      var isDemo = false; //Is this demo?
    </script>
</head>
<body>
    <!-- Ionic's root component and where the app will load -->
    <ion-app></ion-app>

    <script type="text/javascript">
      if (isDemo && isDemoMode()) { //
        $LAB
          .script('build/polyfills.js')
          .script('build/vendor.js')
          .script('build/main.js').wait()
          .script('assets/js/jquery.min.js');
      }else{
        var domain = isDemo ? getDemoHTTPDomain() : "http://192.168.1.171"; //Определим домен
        $LAB
          .script(domain + '/mobilesiteapp/gettemplatesjs/?client_version=1.2&client_name=MobileSiteApp').wait()
          .script('build/polyfills.js')
          .script('build/vendor.js')
          .script('build/main.js').wait()
          .script('assets/js/jquery.min.js');
      }
    </script>
</body>
</html>
paulstelzer commented 5 years ago

This is related to Cordova

ionitron-bot[bot] commented 5 years ago

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.