Android network requests - Random no responses and no response with HTTPS

Hello there,

I am developing an app with this wonderful SDK, everything seems fine but there is one issue with network requests and ANDROID devices. There are two issues:

1- Http

Normal http requests seems to be randomly failing, returning no response at all, thats it, on the callback handler, request.response == nil, and so is request.status (to check for a 200 ).

For example, I could usually do 3 requests, and after that, for the next second or so every request will return no response.

I have tried adding every kind of headers to the request, and also the server response, with no susscess yet.

This ONLY happens on android real devices, works fine on IOS, corona emulator and even android emulator.

2- Https

Compared to normal https, https is always returning no response, always.

I have tested the certificates, and they are fine since I can browse with the device explorer to the site just fine without any certificate warning.

Again, this only happens on android devices.

And also, google and facebook Https seem to work fine with the exact same requests.

So both problems might be related to the server, but who knows why it only breaks with android. So I’m guessing there might a header I haven’t tested yet or another parameter/configuration on the android device.

Additional info: Android devices tested were a sony xperia Z with android 4.3 and samsung galaxy S3 and S4.

Web server is apache hosted on windows, running python/django framework.

There are some fixes in  later daily builds that addresses some Android networking weirdness’s around redirects and such.  The new public build with these changes is coming fairly soon.  I would suggest waiting until the new public build is out and then we can re-attack this since it may be fixed already.

Hello,

After some tests, I can confirm the “no response” issue using normal http request is related to android 4.3, since it doesn’t happen on android 4.4 devices.

However, this is for sure a corona issue, because doing the same code with native java, this doesn’t seem to happen.

I hope it helps, in the console there is always an “ERROR: None” coming from system.out each time the request fails.

About https, it was a server issue with the certificate.

Waiting for the update to see if the android 4.3 issues are solved. Thanks.

Are there any updates to this issue?  We are definitely seeing issues with Android 4.3 devices.  One device that was having lots of problems just got updated to 4.4 and all of the network issues went away.  However, there are lots of 4.3 devices out there!

What version of Corona SDK are you using?

Thanks for responding.

We are using 2014.2186

We need to know what URL’s your trying to hit?  We found an oddity on some Android devices that can’t handle 302 redirects correctly and that was fixed.  There is something you have to do to avoid the auto handling of the redirect. See the documentation:  http://docs.coronalabs.com/api/library/network/request.html

There was another person who reported that her issue when away when she started URL encoding her GET parameters.  Apparently Android 4.3 doesn’t like spaces in the parameters.

There are no redirects, and parameters are encoded.

The requests are working, there is an issue with the network being “sleepy”. When you first do the request it fails (some exception is thrown in java it seems but the error is “None” so no info at all), if you try again in less than 2 seconds the request works fine.

This ONLY happens on android 4.3 devices.

If you have a reproducible test case, then the engineers would appreciate a bug report with the code that causes it.  Usually the simplest code you can produce that has the issue is best.  Please be sure to include the config.lua and build.settings your app is using.

When you get the email from the bug tracker with your bug ID #, please post it back here for reference.

Rob

There are some fixes in  later daily builds that addresses some Android networking weirdness’s around redirects and such.  The new public build with these changes is coming fairly soon.  I would suggest waiting until the new public build is out and then we can re-attack this since it may be fixed already.

Hello,

After some tests, I can confirm the “no response” issue using normal http request is related to android 4.3, since it doesn’t happen on android 4.4 devices.

However, this is for sure a corona issue, because doing the same code with native java, this doesn’t seem to happen.

I hope it helps, in the console there is always an “ERROR: None” coming from system.out each time the request fails.

About https, it was a server issue with the certificate.

Waiting for the update to see if the android 4.3 issues are solved. Thanks.

Are there any updates to this issue?  We are definitely seeing issues with Android 4.3 devices.  One device that was having lots of problems just got updated to 4.4 and all of the network issues went away.  However, there are lots of 4.3 devices out there!

What version of Corona SDK are you using?

Thanks for responding.

We are using 2014.2186

We need to know what URL’s your trying to hit?  We found an oddity on some Android devices that can’t handle 302 redirects correctly and that was fixed.  There is something you have to do to avoid the auto handling of the redirect. See the documentation:  http://docs.coronalabs.com/api/library/network/request.html

There was another person who reported that her issue when away when she started URL encoding her GET parameters.  Apparently Android 4.3 doesn’t like spaces in the parameters.

There are no redirects, and parameters are encoded.

The requests are working, there is an issue with the network being “sleepy”. When you first do the request it fails (some exception is thrown in java it seems but the error is “None” so no info at all), if you try again in less than 2 seconds the request works fine.

This ONLY happens on android 4.3 devices.

If you have a reproducible test case, then the engineers would appreciate a bug report with the code that causes it.  Usually the simplest code you can produce that has the issue is best.  Please be sure to include the config.lua and build.settings your app is using.

When you get the email from the bug tracker with your bug ID #, please post it back here for reference.

Rob

Hi, i have the same problem, It is reproduces randomly, and only with android, is anybody solved it ?  

What URL?

What errors specifically are showing up in your device’s “adb logcat”?

What version of Corona SDK

What device?  What OS?

Do you have some code with your network request and it’s call back listener you can post?

Rob

Hi, i have the same problem, It is reproduces randomly, and only with android, is anybody solved it ?