What does "Network error! -1" mean?

Our engineers have tested it in the office and can’t duplicate the problem  Hopefully Google will have an answer for it soon.

Same problem here (isError = true and status = -1) when making calls to a Amazon S3 service.

My code works fine on iOS but fails on android.

I tested it on a Galaxy Tab p7510. Android version 4.0.4

Just keep in mind that we return those errors to you for a reason.  If you get an isError is true its likely a time out of some sort, and you probably should try the connection a couple of times before giving up.  Everyone else who’s done this solved the problem.

Same problem here (isError = true and status = -1) when making calls to a Amazon S3 service.

My code works fine on iOS but fails on android.

I tested it on a Galaxy Tab p7510. Android version 4.0.4

Just keep in mind that we return those errors to you for a reason.  If you get an isError is true its likely a time out of some sort, and you probably should try the connection a couple of times before giving up.  Everyone else who’s done this solved the problem.

Hi everyone,

This is the EXACT same error I’m having: 

http://forums.coronalabs.com/topic/42980-networkdownload-fails-only-on-android-not-on-ios-or-in-simulator-on-urls-that-used-to-work/ 

What I’ve discovered…

  1. It seems to only happen for me with items that are on Amazon S3 servers, other servers are working fine

  2. The same code works PERFECT with Amazon S3 servers on iOS or the MAC or Windows simulators, the error ONLY happens on Android devices.

  3. I’ve tested the error on both a Nexus 7 tablet running Android 4.4.2 and a new Samsung Galaxy Tablet

  4. This hasn’t been a problem until just recently, the code was not changed when the error happened

I have code and a URL to replicate the issue on the other forum page with a zip file attached to make an app to replicate this issue.

I can’t imagine Corona Staff (or anybody else) won’t be able to replicate the issue using my code with the Amazon S3 URL.  It doesn’t seem we should have to do the re-try.

Netwotk error -1 happens also if the OS rejects the connection. In my case it happend because the certificate on my server was not fully trusted (self signed cert or no intermidiate cert). Android has less trusted root certificates registered than windows or iOS thus you get issues like this. Android could also be rejecting connections due to other reasons. In my case the error was consistent not random.

Has anyone filed a bug report on this issue?

Thanks

Rob

It only occurred when I called too many network requests. Delaying one out 5 seconds helped.

Hi everyone,

This is the EXACT same error I’m having: 

http://forums.coronalabs.com/topic/42980-networkdownload-fails-only-on-android-not-on-ios-or-in-simulator-on-urls-that-used-to-work/ 

What I’ve discovered…

  1. It seems to only happen for me with items that are on Amazon S3 servers, other servers are working fine

  2. The same code works PERFECT with Amazon S3 servers on iOS or the MAC or Windows simulators, the error ONLY happens on Android devices.

  3. I’ve tested the error on both a Nexus 7 tablet running Android 4.4.2 and a new Samsung Galaxy Tablet

  4. This hasn’t been a problem until just recently, the code was not changed when the error happened

I have code and a URL to replicate the issue on the other forum page with a zip file attached to make an app to replicate this issue.

I can’t imagine Corona Staff (or anybody else) won’t be able to replicate the issue using my code with the Amazon S3 URL.  It doesn’t seem we should have to do the re-try.

Netwotk error -1 happens also if the OS rejects the connection. In my case it happend because the certificate on my server was not fully trusted (self signed cert or no intermidiate cert). Android has less trusted root certificates registered than windows or iOS thus you get issues like this. Android could also be rejecting connections due to other reasons. In my case the error was consistent not random.

Has anyone filed a bug report on this issue?

Thanks

Rob

It only occurred when I called too many network requests. Delaying one out 5 seconds helped.

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

Hi,
I don’t know the cause, however a reliable solution is to write a function wrapping network request and retry your request upon failure. After the first request the second one always goes through.
You should then use your wrapper function for all requests throughout your app.

This has been working for us for the past year with around a couple hundred thousand users without any problems.

Regarding the solution I’ve offered above, be sure to add a tiny (10ms) delay between each retry attempt.

So glad this topic was here, this -1 error was causing me to pull my hair out. The wrapped network request solution seems to have worked though.

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

Hi,
I don’t know the cause, however a reliable solution is to write a function wrapping network request and retry your request upon failure. After the first request the second one always goes through.
You should then use your wrapper function for all requests throughout your app.

This has been working for us for the past year with around a couple hundred thousand users without any problems.

Regarding the solution I’ve offered above, be sure to add a tiny (10ms) delay between each retry attempt.