Urgent! Stuck on splash screen - Failed to load webpage with error: The Internet connection appears to be offline


#1

Our app connects to a database hosted internally by our company so we access it via VPN. The app works online when connected to VPN without any issues, and also when completely offline. However, when we test it with the phone connected to internet but without VPN access, the app is stuck on the splash screen. The Xcode console (we currently use this to deploy to the phone) displays the following:

2018-04-11 10:28:52.096512+0100 AppName[8733:4864738] Apache Cordova native platform version 4.5.3 is starting.
2018-04-11 10:28:52.097326+0100 AppName[8733:4864738] Multi-tasking -> Device: YES, App: YES
[DEBUG] Did open IPv4 listening socket 6
[DEBUG] Did open IPv6 listening socket 7
[INFO] GCDWebServer started on port 8080 and reachable at http://localhost:8080/
2018-04-11 10:28:52.108603+0100 AppName[8733:4864738] CDVWKWebViewEngine: trying to inject XHR polyfill
2018-04-11 10:28:52.154529+0100 AppName[8733:4864738] [MC] Lazy loading NSBundle MobileCoreServices.framework
2018-04-11 10:28:52.155268+0100 AppName[8733:4864738] [MC] Loaded MobileCoreServices.framework
2018-04-11 10:28:52.158920+0100 AppName[8733:4864738] CDVWKWebViewEngine will reload WKWebView if required on resume
2018-04-11 10:28:52.158977+0100 AppName[8733:4864738] Using Ionic WKWebView
2018-04-11 10:28:52.159772+0100 AppName[8733:4864738] [CDVTimer][console] 0.440955ms
2018-04-11 10:28:52.159965+0100 AppName[8733:4864738] [CDVTimer][handleopenurl] 0.126958ms
2018-04-11 10:28:52.161782+0100 AppName[8733:4864738] [CDVTimer][intentandnavigationfilter] 1.785040ms
2018-04-11 10:28:52.161936+0100 AppName[8733:4864738] [CDVTimer][gesturehandler] 0.106931ms
2018-04-11 10:28:52.164264+0100 AppName[8733:4864738] [CDVTimer][file] 2.267003ms
2018-04-11 10:28:52.180419+0100 AppName[8733:4864738] [CDVTimer][splashscreen] 16.108036ms
2018-04-11 10:28:52.186649+0100 AppName[8733:4864738] [CDVTimer][statusbar] 6.148934ms
2018-04-11 10:28:52.188729+0100 AppName[8733:4864738] [CDVTimer][keyboard] 1.959920ms
2018-04-11 10:28:52.188816+0100 AppName[8733:4864738] [CDVTimer][TotalPluginStartup] 29.496908ms
2018-04-11 10:28:52.400245+0100 AppName[8733:4864738] Failed to load webpage with error: The Internet connection appears to be offline.

The app stays on the splash screen and nothing else happens.

Our plugin list is:

ionic cordova plugin ls
> cordova plugin ls
call-number 0.0.2 "Cordova Call Number Plugin"
cordova-plugin-app-event 1.2.1 "Application Events"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-badge 0.7.4 "Badges"
cordova-plugin-camera 2.4.1 "Camera"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-device 1.1.7 "Device"
cordova-plugin-email 1.2.7 "EmailComposer"
cordova-plugin-file 4.3.3 "File"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-media 3.0.1 "Media"
cordova-plugin-media-capture 1.4.3 "Capture"
cordova-plugin-network-information 1.3.4 "Network Information"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.2.2 "StatusBar"
cordova-plugin-whitelist 1.3.1 "Whitelist"
cordova-plugin-wkwebview-engine 1.1.6 "Cordova WKWebView Engine"
cordova-plugin-x-toast 2.6.2 "Toast"
cordova-sqlite-storage 2.0.4 "Cordova sqlite storage plugin"
ionic-plugin-keyboard 2.2.1 "Keyboard"

Our config.xml (some details have been omitted for our company’s privacy):

    <content src="index.html" />
    <access origin="*" />
    <allow-navigation href="http://ionic.local/*" />
    <allow-navigation href="http://192.168.1.66:8100" />
    <allow-intent href="https://*/*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <allow-navigation href="http://localhost:8080/*" />
    <feature name="CDVWKWebViewEngine">
        <param name="ios-package" value="CDVWKWebViewEngine" />
    </feature>
    <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
    <preference name="webviewbounce" value="false" />
    <preference name="UIWebViewBounce" value="false" />
    <preference name="DisallowOverscroll" value="true" />
    <preference name="android-minSdkVersion" value="16" />
    <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="SplashScreenDelay" value="3000" />
    <preference name="orientation" value="portrait" />
    <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" />
        <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" />
        <icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" />
        <splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
    </platform>
    <engine name="android" spec="^6.4.0" />
    <engine name="ios" spec="^4.5.4" />
    <plugin name="call-number" spec="^1.0.1" />
    <plugin name="cordova-plugin-app-version" spec="^0.1.9" />
    <plugin name="cordova-plugin-badge" spec="^0.7.4" />
    <plugin name="cordova-plugin-camera" spec="^2.4.1">
        <variable name="CAMERA_USAGE_DESCRIPTION" value=" " />
        <variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value=" " />
    </plugin>
    <plugin name="cordova-plugin-device" spec="^1.1.7" />
    <plugin name="cordova-plugin-email" spec="^1.2.7" />
    <plugin name="cordova-plugin-geolocation" spec="^4.0.1" />
    <plugin name="cordova-plugin-media" spec="^3.0.1">
        <variable name="MICROPHONE_USAGE_DESCRIPTION" value=" " />
    </plugin>
    <plugin name="cordova-plugin-media-capture" spec="^1.4.3">
        <variable name="CAMERA_USAGE_DESCRIPTION" value=" " />
        <variable name="MICROPHONE_USAGE_DESCRIPTION" value=" " />
        <variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value=" " />
    </plugin>
    <plugin name="cordova-plugin-network-information" spec="^1.3.4" />
    <plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
    <plugin name="cordova-plugin-statusbar" spec="^2.2.2" />
    <plugin name="cordova-plugin-whitelist" spec="^1.3.1" />
    <plugin name="cordova-plugin-wkwebview-engine" spec="git+https://github.com/ionic-team/cordova-plugin-wkwebview-engine.git" />
    <plugin name="cordova-plugin-x-toast" spec="^2.6.2" />
    <plugin name="cordova-sqlite-storage" spec="^2.0.4" />
    <plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
    <plugin name="mx.ferreyra.callnumber" spec="0.0.2" />

We need to get this app out by the end of the week and we are stumped on this! Any help would be brilliant, thank you.


#2

I have no experience with this, but I would suggest trying to do a build on android to see what happens then. And investigate the logs. Cross platform gives sometimes other results.

If at all possible.


#3

What is your database connection code? How are you handling failures?