Failed to load "page" resource: Could not connect to the server (iOS app)

In my iOS device App, I’m having the following problem after I let my app a few moment in background and return to it:
image

This image is from iOS device. I inspected from Safari.

Some screens not work, forcing me to close the app and open again to reload. Why does it happen? How can I solve this?

Thanks.

How was this app installed on your device?
How did you build the app?

The app is already on App Store. I built the app following the steps:

  1. ionic prepare (on terminal)
  2. I opened xcode project in “AppFolder/platforms/ios/App.xcodeproj” and built it there.
  3. And so I followed the steps to publish the app in App Store.

Before this, I already tested in devices directly, through cable in xcode project, and the same this was happening. :frowning:

‘ionic info’ output and ‘package.json’ please.

Ionic info

Cordova CLI: 6.5.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
ios-deploy version: 1.9.1
ios-sim version: 5.0.13
OS: macOS Sierra
Node Version: v6.9.5
Xcode version: Xcode 8.3 Build version 8E162


Package.json

{
“name”: “app”,
“version”: “1.1.1”,
“description”: “Ionic: An Ionic project”,
“devDependencies”: {
“bower”: “^1.3.3”,
“del”: “^2.2.0”,
“gulp”: “^3.9.1”,
“gulp-autoprefixer”: “^3.1.0”,
“gulp-concat”: “^2.2.0”,
“gulp-gh-pages”: “^0.5.4”,
“gulp-htmlmin”: “^1.3.0”,
“gulp-imagemin”: “^2.4.0”,
“gulp-jshint”: “^2.0.1”,
“gulp-minify-css”: “^0.3.0”,
“gulp-notify”: “^2.2.0”,
“gulp-rename”: “^1.2.0”,
“gulp-sass”: “^2.0.4”,
“gulp-sourcemaps”: “^1.6.0”,
“gulp-uglify”: “^1.5.3”,
“gulp-util”: “^2.2.14”,
“jshint”: “^2.9.4”,
“merge2”: “^1.0.2”,
“preen”: “^1.2.0”,
“pump”: “^1.0.1”,
“shelljs”: “^0.3.0”
},
“cordovaPlugins”: [
“cordova-plugin-device”,
“cordova-plugin-whitelist”,
“cordova-plugin-splashscreen”,
“cordova-plugin-statusbar”,
“ionic-plugin-keyboard”,
“cordova-plugin-device@~1.1.1”,
“cordova-plugin-console@~1.0.2”,
“cordova-plugin-whitelist@~1.2.1”,
“cordova-plugin-splashscreen@~3.2.0”,
“cordova-plugin-statusbar@~2.1.1”,
“ionic-plugin-keyboard@~1.0.8”,
“cordova-plugin-x-toast”,
“cordova-plugin-network-information”,
“cordova-plugin-inappbrowser”,
“cordova-plugin-globalization”,
“cordova-plugin-app-version”,
“cordova-plugin-file”,
“cordova-plugin-file-transfer”,
“phonegap-plugin-push”,
“cordova.plugins.diagnostic”,
“cordova-plugin-console”,
“cordova-plugin-camera”
],
“cordovaPlatforms”: [
“android”
]
}

Any idea what this might be? :frowning:

Are files in your iOS app usually served from localhost:8080?
(Honest question, I actually don’t know)

I executed the app normally. The problem is, when I open the app for the first time, the screens are opened normally, but if I suspend the app pressing the Home Button, and after this open again, the screens which weren’t opened before the suspension give me the error of the images. When I resume the app from background, only the screens which were opened before the suspension can load.

I just solved!!! The problem was because I was using “Cordova WKWebView Engine” as iOS webview, and I don’t know why it was causing me this problem. I uninstalled this webview and now it is working normally. Thanks @Sujan12 :slight_smile:

1 Like

How did you find out that you were using Cordova WKWebView Engine" as iOS webview?

Thanks

He probably had this https://github.com/driftyco/cordova-plugin-wkwebview-engine or a similar plugin installed in his project.

1 Like