Android Google Play ***ERROR REPORT! - Ansca Tech I need your help please.

Hi Ansca Team, @ewing, @joshua, etc ,

I`ve just got an error report from my last app released on Google Play store, and the details of the ERROR reported is shown below:

java.lang.NullPointerException

java.lang.NullPointerException at com.loopj.android.http.AsyncHttpClient$2.process(Unknown Source) at org.apache.http.protocol.BasicHttpProcessor.process(BasicHttpProcessor.java:304) at org.apache.http.protocol.HttpRequestExecutor.postProcess(HttpRequestExecutor.java:319) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:548) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487) at com.loopj.android.http.AsyncHttpRequest.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581) at java.lang.Thread.run(Thread.java:1019)
So devs, what would this error be about?

PS: FYI, my app does use internet connection and Ads, nothing else.

Thank you in advance guys,

Rodrigo.
[import]uid: 89165 topic_id: 26382 reply_id: 326382[/import]

@Ansca - Are any of you there able to help/answer me?

Thank you,
Rodrigo. [import]uid: 89165 topic_id: 26382 reply_id: 107041[/import]

Rodrigo,

This is the first I’ve heard of this error. Are you able to reproduce this error for yourself? If so, then can you send us a small sample project that reproduces it please? You can do so by clicking the “Report a Bug” link at the top of this web page. [import]uid: 32256 topic_id: 26382 reply_id: 107109[/import]

@Joshua, THANK YOU!
By the way, the problem is exactly the fact that I CANNOT reproduce the ERROR by anyway! I do not see any errors when testing on my device BUT sure there are a lot more different Android devices out there and so it`s the problem.

Anyway, do you have “any idea” what could be this error all about Joshua? It would help to know where to try to reproduce the error.
Basically, what does that ERROR MESSAGE means for you?
One more time, really thanks!

Aprreciate that.
Rodrigo. [import]uid: 89165 topic_id: 26382 reply_id: 107122[/import]

The stack trace that you provided us indicates that it is crashing in Apache’s code and not in the Corona code. So that makes it difficult for us to “guess” what the root cause is.

I had a hard look at the open source 3rd party library that we use for async network communications (that’s the “com.loopj” class that you see in the stack trace) and noticed that it is not catching all possible exceptions that can occur when doing HTTP requests via Apache’s framework. Particularly the “ClientProtocolException” which can happen if the response packet is malformed. Since this 3rd party code is open source, I’ll go ahead and add the extra exception handling which will prevent the crash and instead error out gracefully and notify your Lua listener.

That said, this is just a guess on my part since neither you or I know the root cause of this issue. This change will prevent the crash, but it won’t prevent the error that the app reviewer encountered. But if it is a malformed HTTP response, then erroring out gracefully is the correct thing to do. [import]uid: 32256 topic_id: 26382 reply_id: 107372[/import]

Rodrigo,

I went ahead and added that extra error/exception handling to Corona which will prevent it from crashing on Google. It will call your Lua listener with an event.isError set to true instead in that case. This change should make it into tomorrow’s daily build. Keep a look out for release notes with a fix for network.request()/download(). Thanks for reporting this issue to us. [import]uid: 32256 topic_id: 26382 reply_id: 107383[/import]

@Joshua ,

What a amazing reply from you mate! THANK YOU! :slight_smile:

Even you not knowing the “root” of the problem, but taking your time to READ and INVESTIGATE the issue is not less than awesome IMHO.

So, just to keep you even more “informed”, I believe youre going in the right way, because my app does use the HTTP request at major part of the time and so I believe that the problem is concerning what youre looking for as well.

PS: By the way, what is strange is that it started to happen only after I release the app built with the latest Corona stable build (2012.704b) because before that, the app was LIVE and was built with the Corona stable build (591) without show me any errors like this.

PS2: Having the ERROR popping out by the Lua listener will be wonderful. One more bug catcher, haha. :wink:
Thank you so much,
Rodrigo. [import]uid: 89165 topic_id: 26382 reply_id: 107416[/import]

Happy to help! You happened to catch my attention just as I was finishing something that took me 3 days to finish. The issue you brought up was an easy 1 line fix and I’m happy to sneak those in between the larger tasks that I usually have to do.

Good luck with your app! [import]uid: 32256 topic_id: 26382 reply_id: 107609[/import]

@ Joshua ,

Sure, glad to hear that too!

As soon as I see some “abnormal error” like this popping-out on my “Android dashboard”, be sure I will report my Team (ops…you and your Team) to have a look into the issue regarding “investigate” the error as you`ve just beautifully done right now. :wink:
Cheers,
Rodrigo. [import]uid: 89165 topic_id: 26382 reply_id: 107612[/import]

One of my users got this error today too, and I’m using the latest Corona build. The only thing I use for internet connection is revmob ads.

Here is my app https://play.google.com/store/apps/details?id=com.games.lightpaths&feature=search_result#?t=W251bGwsMSwxLDEsImNvbS5nYW1lcy5saWdodHBhdGhzIl0

The crash was on a Samsung Galaxy Nexus btw.

-Oskar [import]uid: 24111 topic_id: 26382 reply_id: 110872[/import]

Oskar,

If it’s the same error that Rodrigo got, then the crash is fixed in the newest daily build. Now, the network error can still happen, but there is nothing we can do about that. Network errors *will* happen. They’re normal and happen all of the time. Your code just needs to handle it gracefully and retry the network request later until it finally succeeds… or gives up after too many failures. This comes from my experience writing server software for over 10 years. [import]uid: 32256 topic_id: 26382 reply_id: 110906[/import]