cordova-plugin-ionic-webview icon indicating copy to clipboard operation
cordova-plugin-ionic-webview copied to clipboard

Failed to load webpage with error: Count not connect to the server

Open bigrivi opened this issue 6 years ago • 7 comments

Dear All ,

Could you please help us diagnose the following issue?

The issue is reproduced according to the below steps:

The precondition: APP is upgraded to cordova-plugin-ionic-webview

The reproduced steps/scenarios are as below:

1.Open the app.

2.Press Home key.

3.Go to the backend process, to ensure the IOS is hung up in the backend.

4.Keep the app open for 2 Days in the backend and never open the app screen to do anything again.

5.After 2 days, we will recieve one app message push.

6.Right now open the App, we found that the process might be killed as cordova will restart the process to reload the webview.

7.we found that the app will be failed to open and it will stay at the splashscreen.

8.We checked the log is that " Failed to load webpage with error: Count not connect to the server."

Due to the above issue, we can't directly open the APP continually, and we just find only way to open the App again that we close the process in the backend.

We are not sure if the current port 8080 is occupied, so the server will not be started up.

We tried many methods to fix it, but the issue is still plagued us so far, and we don't know how to fix it.

Could you please help us on this? Thanks.

bigrivi avatar Aug 01 '18 05:08 bigrivi

I am experiencing the very same issue. I am using cordova-plugin-ionic-webview 1.x and event 2.x has this issue. I tried set WKEnableBackground to true (in 1.x version) or WKSuspendInBackground to false (in 2.x version) with no success

lzoubek avatar Aug 01 '18 07:08 lzoubek

I was able to resolve the issue with 1.x version. I've set WKEnableBackground to true and applied patch from #124 Feel free to try out patched version

lzoubek avatar Aug 06 '18 15:08 lzoubek

@lzoubek thanks

bigrivi avatar Aug 07 '18 08:08 bigrivi

@sunjianghong well, I found out, that the patch has a side effect. My app (with patch applied) started to randomly respond to user clicks/taps. Sometimes I click on ion-item and it does not do anything at all, sometimes it perfroms desired action.

If you try it out anyway, I'd be happy to see the results.

So .. for me it's not usable solution. I'll try upgrade to 2.x and apply patch there.

lzoubek avatar Aug 07 '18 08:08 lzoubek

isn't this fixed with the latest version and <preference name="WKSuspendInBackground" value="false" /> ?

andrewvmail avatar Oct 08 '18 22:10 andrewvmail

try to run using --verbose option, mine is solved.

itshazlan avatar Aug 29 '20 15:08 itshazlan

I had the same error and my mistake was my build command was ionic build iOS instead of ionic cordova build ios

mpeguero avatar May 13 '22 18:05 mpeguero