App doesn't work on 3G/4G

Hi,

I am having a very weird behavior in my app. It works totally fine on wifi and when no connection. But when I’m using 4G connection in a Motorola Moto X, I open my app, it hangs on a black screen and after a few seconds it throws CordovaWebView: TIMEOUT ERROR! and then loads the page and works normally!

When I check the logs (adb logcat) I don’t see any other error.

Anyone has an idea of what it could be? Why would it hang and throw CordovaWebView: TIMEOUT ERROR! and then work normally after the error?

My first thought was that something was wrong with AndroidManifest permissions, but there is nothing different required for mobile network other than what is required for wifi.

Thanks!

Are you using the livereload package instead of a normal Debug apk?

Hi @vicmota, what do you mean by a livereload package? Not that I am aware of. Actually my app is already live on production (I just realized the bug after I sent it).

Actually I misread your post. Strange thing is I cannot reproduce your error on my phone. Just started a new project, installed the release version and tried on 3G. It worked without any timeout. Can you try doing that?

Hey @vicmota, I tried doing what you said and it was working as well, which made me conclude it was something wrong with my initialization. So I checked my index.html and realized my debugger script (which tries to connect to a local server) was not commented out. Anyway, it was me being stupid! Your suggestion was very helpful as it was what made me dig into the issue, thanks a lot!

Are you connecting to a localhost connection? If you’re going over a cellular data connection you’ll need to be pointing to a live server, not your local server.

Haha, I didn’t read all the comments before! :slight_smile:

Did you solve this?

I am having a similar issue.

This is iOS specific, everything works as expected on Android. iOS only works on wifi, it does not work on cellular network 3g or 4g.

The services that are being accessed are not local, they are cloud API services that are in full production.

Any insight is appreciated on how to fix this.

Hello, I have the same issue.
How have you fixed it?!?
Thanks

hi man , did you find any solution to resolve this problem

This was a while ago, but I think we enable long URL loading or something like that. It was only an android issue for us, but what a pain.