Android Exceptions

22 replies [Last post]
kimruben
User offline. Last seen 4 years 11 weeks ago. Offline
Joined: 23 May 2011

Hi

Just wondering if you have any insight on these common crashes?
These are caught relatively often, but isn't something that happens to every Android user.

Stack Trace
_________________________________
0 android.app.RemoteServiceException: Bad notification posted from package no.monkeybin.mindfeud: Couldn't expand RemoteViews for: StatusBarNotification(pkg=no.monkeybin.mindfeud id=32 tag=null score=0 notn=Notification(pri=0 contentView=no.monkeybin.mindfeud/0x109008e vibrate=null sound=content://no.monkeybin.mindfeud.files/assets/notification.wav defaults=0x0 flags=0x18 kind=[null]) user=UserHandle{0})
1 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1411)
2 at android.os.Handler.dispatchMessage(Handler.java:99)
3 at android.os.Looper.loop(Looper.java:137)
4 at android.app.ActivityThread.main(ActivityThread.java:5191)
5 at java.lang.reflect.Method.invokeNative(Native Method)
6 at java.lang.reflect.Method.invoke(Method.java:511)
7 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
8 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
9 at dalvik.system.NativeStart.main(Native Method)

And this one:
Stack Trace
_________________________________
0 android.app.RemoteServiceException: Bad notification posted from package no.monkeybin.mindfeud: Couldn't create icon: StatusBarIcon(pkg=no.monkeybin.mindfeud id=0x7f020001 level=0 visible=true num=0 )
1 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1271)
2 at android.os.Handler.dispatchMessage(Handler.java:99)
3 at android.os.Looper.loop(Looper.java:137)
4 at android.app.ActivityThread.main(ActivityThread.java:4511)
5 at java.lang.reflect.Method.invokeNative(Native Method)
6 at java.lang.reflect.Method.invoke(Method.java:511)
7 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
8 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
9 at dalvik.system.NativeStart.main(Native Method)

Replies

Joshua Quick
User offline. Last seen 52 weeks 1 hour ago. Offline
Staff
Joined: 31 Jan 2011

I've never seen Corona cause this error before.

Are you posting a Notification object in Java yourself? Because I believe this error occurs if you attempt to post a misconfigured Notification object to the NotificationManager. You are supposed to use the "Notification.Builder" class to create Notification objects when running on Android 3.0 or higher.

kimruben
User offline. Last seen 4 years 11 weeks ago. Offline
Joined: 23 May 2011

Hi

No, we're not posting anything ourselves.
We found that others(non corona) have similar issues on 2.3.

- http://stackoverflow.com/questions/6209631/android-bad-notification-posted-couldnt-expand-remoteviews-for-statusbarno
- http://stackoverflow.com/questions/12843119/android-bad-notification-posted-only-on-android-2-3
- https://groups.google.com/forum/?fromgroups=#!topic/android-developers/PcDckIcL9U8

So, please look into this on your side..

Joshua Quick
User offline. Last seen 52 weeks 1 hour ago. Offline
Staff
Joined: 31 Jan 2011

So far, we can't reproduce this issue. And those stackoverflow posts are not applicable since we do not use remote views. The stack traces that you've posted above do not have anything Corona related in them. So, the exception is not coming from Corona's code. It looks like the exception is happening on app startup and it looks like it has something to do with your notification wav file.

I'm guessing that your wav file plays correctly for you, right?

I tried adding an status bar notification with a custom wav file and then moving the app to the SD card (and vice-versa) in case it was a file lookup issue, but it still played the notification wav file correctly. And it should too because we use that "com.ansca.corona.FileContentProvider" that you can see in our AndroidManifest.xml file which provides access to that wav file via a URL using the app's unique package name. We put a lot of thought into the design of this to make it work reliably.

Are you able to reproduce this issue on any of your devices?

Also, can you also tell us which Android devices and Android OS versions these crashes came from?
(Just in case this is a device specific issue.)

kimruben
User offline. Last seen 4 years 11 weeks ago. Offline
Joined: 23 May 2011

Hi

We're not able to reproduce this ourselves.
And yes, everything works just fine on all our devices.

As far as I can see in Crittercism, it happens for the most part on Honeycomb, ICS and JB and all api levels for those Android versions.

I picked one error group for a device stat:(Group had 51 error instances)
46 of them was GT-I9100
2 was GT-N7000
1 was GT-I9100G
1 was Alcatel_on_touch_995
1 was Nexus S

Let me know if you want to dig around in all these stats for the various stack traces we are seeing.

Kim Ruben

kimruben
User offline. Last seen 4 years 11 weeks ago. Offline
Joined: 23 May 2011

We just published an update on Google Play, and have a new stack trace that we haven't had before.
The latest live version was built using 1031.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Stack Trace
_________________________________
0       java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=2, result=-1, data=Intent { dat=content://com.google.android.gallery3d.provider/picasa/item/5785803843059147810 }} to activity {no.monkeybin.mindfeud/com.ansca.corona.CoronaActivity}: java.lang.NullPointerException: println needs a message
1               at android.app.ActivityThread.deliverResults(ActivityThread.java:3141)
2               at android.app.ActivityThread.handleSendResult(ActivityThread.java:3184)
3               at android.app.ActivityThread.access$1100(ActivityThread.java:130)
4               at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1243)
5               at android.os.Handler.dispatchMessage(Handler.java:99)
6               at android.os.Looper.loop(Looper.java:137)
7               at android.app.ActivityThread.main(ActivityThread.java:4745)
8               at java.lang.reflect.Method.invokeNative(Native Method)
9               at java.lang.reflect.Method.invoke(Method.java:511)
10              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
11              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
12              at dalvik.system.NativeStart.main(Native Method)
13      Caused by: java.lang.NullPointerException: println needs a message
14              at android.util.Log.println_native(Native Method)
15              at android.util.Log.d(Log.java:138)
16              at com.ansca.corona.CoronaActivity.onActivityResult(CoronaActivity.java:1225)
17              at android.app.Activity.dispatchActivityResult(Activity.java:5192)
18              at android.app.ActivityThread.deliverResults(ActivityThread.java:3137)
19              ... 11 more
20      java.lang.NullPointerException: println needs a message
21              at android.util.Log.println_native(Native Method)
22              at android.util.Log.d(Log.java:138)
23              at com.ansca.corona.CoronaActivity.onActivityResult(CoronaActivity.java:1225)
24              at android.app.Activity.dispatchActivityResult(Activity.java:5192)
25              at android.app.ActivityThread.deliverResults(ActivityThread.java:3137)
26              at android.app.ActivityThread.handleSendResult(ActivityThread.java:3184)
27              at android.app.ActivityThread.access$1100(ActivityThread.java:130)
28              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1243)
29              at android.os.Handler.dispatchMessage(Handler.java:99)
30              at android.os.Looper.loop(Looper.java:137)
31              at android.app.ActivityThread.main(ActivityThread.java:4745)
32              at java.lang.reflect.Method.invokeNative(Native Method)
33              at java.lang.reflect.Method.invoke(Method.java:511)
34              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
35              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
36              at dalvik.system.NativeStart.main(Native Method)

I'm gonna take a guess that this is caused by users picking images from picasa albums.
Now, that does not cause any errors on our SIII, but some of the reports come from Nexus 7s.

Why would we see this error now, and not before?

kimruben
User offline. Last seen 4 years 11 weeks ago. Offline
Joined: 23 May 2011

Any update on this?

Also, is there any reason why you can't return the urls for network media to the listener?
As the stack traces for picasa media and also google content media shows the urls.

Joshua Quick
User offline. Last seen 52 weeks 1 hour ago. Offline
Staff
Joined: 31 Jan 2011

Regarding the exception with the PhotoLibrary, we believe that was caused by daily build #1030.
http://developer.coronalabs.com/release/2013/1030/

We were not able to reproduce this issue for ourselves, but we saw the potential error in our code and made a "blind" fix for it. This fix will be made available in daily build #1033, tomorrow.

Also, we do not provide the URL to the file because iOS does not provide an equivalent path (iOS provides the image data instead. This prevents us from providing a cross-platform API for it. So, this is why we've set up our media.show() API with the option to save the image as a local file instead, which we can do on both the Android and iOS platforms easily, making it cross-platform.

Joshua Quick
User offline. Last seen 52 weeks 1 hour ago. Offline
Staff
Joined: 31 Jan 2011

Regarding the notification exceptions, I don't believe that the error about "RemoteViews" is coming from Corona. Corona does not create remote views under the status bar. Nor does Corona ever expand view from XML as the exception message indicates. Since you have Corona Enterprise, if you look under the "android/lib/Corona/res" directory, notice that we have no XML files to expand a view from.

Are you using any 3rd party libraries?
If so, can you tell me which ones you are using?
Because I'm thinking that a 3rd party library is trying to add status bar notification within your app and it may be conflicting with Corona's status bar notifications. If this is the case, then we can work with you on providing a solution to this.

haakon
User offline. Last seen 3 years 31 weeks ago. Offline
Joined: 19 Jan 2011

Hi Joshua,

I suspect that either Chartboost may be the library that tries to add the status bar notification. Yesterday we submit an update of an old game to Apple, and I got an automated email from iTunesConnect about a "Missing Push Notification Entitlement". The only plugin in the project is Chartboost.

Btw, when I tried to remove the Facebook SDK and Facebook resources from the iOS project, it would not build as there was a dependency in libplayer.a. Can you get the iOS team to remove that dependency?

One more thing. I implemented the table-fix for image downloads yesterday, and it works fine on iOS. I don't know about Android yet - Kim is asleep :). But there's a bug in the simulator you should take a look at. This exception is thrown when you run this piece of code and select an image:

1
2
3
4
5
media.show(media.PhotoLibrary, function(event)
        if event and event.completed then
                display.newImage("image.jpg", system.TemporaryDirectory)
        end
end, {baseDir=system.TemporaryDirectory, filename="image.jpg", type="image"})

Throws this exception:

1
2
3
4
5
-ImageKit Error: texturePacker: glGetError returned an error before createTexturePackerAtIndex err=1286 (in context: 0x102c7e000)
2013-02-22 09:48:27.304 Corona Simulator[45626:707] MacImageProvider::Show: got removeItemAtURL error Error Domain=NSCocoaErrorDomain Code=4 "“image.jpg” couldn’t be removed." UserInfo=0x10a9be2e0 {NSFilePath=/Users/Haakon/Library/Application Support/Corona Simulator/Corona-989FFEA0A0056F1363B0E32117AF72FE/tmp/image.jpg, NSUserStringVariant=(
    Remove
), NSUnderlyingError=0x10a9c9620 "The operation couldn’t be completed. No such file or directory"}
2013-02-22 09:48:27.319 Corona Simulator[45626:707] glCheckFramebufferStatus error at end unbindRenderFBO

kimruben
User offline. Last seen 4 years 11 weeks ago. Offline
Joined: 23 May 2011

Hey

So, the optional file param doesn't seem to work on Android.
It just returns a false for event.completed

1
2
3
4
5
6
7
8
9
10
11
media.show(media.PhotoLibrary, function(event)
    -- We only receive event.completed == false here...
    if event and event.completed then
        local image = display.newImage("image.jpg", system.TemporaryDirectory)
        if image then
                -- Do something with the image..
        else
                -- Fail
        end
    end
end, {baseDir=system.TemporaryDirectory, filename="image.jpg", type="image"})

Did we get something wrong here??

kimruben
User offline. Last seen 4 years 11 weeks ago. Offline
Joined: 23 May 2011

Forgot to mention that this is for images that are not on device.
Try this with picasa, skydrive or dropbox images.

Joshua Quick
User offline. Last seen 52 weeks 1 hour ago. Offline
Staff
Joined: 31 Jan 2011

Regarding the status bar notification exception, I think Corona and Chartboost must be using the same status bar notification IDs, causing a conflict. Okay, so this was a good find. I modified Corona's notification handling by giving Corona's notifications a unique string tag as well, per the Android documentation link below. That will prevent this from happening in the future.
http://developer.android.com/reference/android/app/NotificationManager.html

We also fixed that Android TextField/TextBox exception that you brought up on your Crittercism forum thread.

Both of the above changes will be made available in daily build #1035.

haakon
User offline. Last seen 3 years 31 weeks ago. Offline
Joined: 19 Jan 2011

Great Joshua, we'll move to 1035.

What about the external images that cant be used on Android, is that going to be fixed or not? If you're not going to fix it, you should at least return a reason when event.completed is false. We can write a new media.show plugin that fixes it for us, but the problem affects all Corona built Android apps.

Joshua Quick
User offline. Last seen 52 weeks 1 hour ago. Offline
Staff
Joined: 31 Jan 2011

I've just informed the rest of our team about the iOS Facebook SDK reference issue and about the Corona Simulator crashing via media.show() when saving to file. I'll also make sure to bug them in-person about it during on Monday.

Regarding selecting a photo from a 3rd party app, I just tried it with SkyDrive and noticed that we are not getting a file path from it. It looks like we don't have direct file access to SkyDrive's files, which makes sense if they're in that app's private files directory instead of external storage, so we'll have to fetch the photo's bytes via an Android ContentProvider. I'll write up a bug report about to get it in our queue.

By the way, which Picasa app are you testing with on Google Play?

Joshua Quick
User offline. Last seen 52 weeks 1 hour ago. Offline
Staff
Joined: 31 Jan 2011

Oh and our media.show() API can successfully save photos on Android from the standard "Gallery" app on all Android devices, include Kindle Fire and Nook. This is just an issue with photo apps that do not share pictures via external storage... or that provide file access via a ContentProvider's openFile() method. We'll definitely need to add support for that since you have no control over what the default photo gallery app is on the device.

haakon
User offline. Last seen 3 years 31 weeks ago. Offline
Joined: 19 Jan 2011

Yup, thats right Joshua. The Picasa app we're testing with is the default one that's shipped with the Galaxy S3, so I guess it's Googles app.

Are you able to say anything about when you'll look at implementing the openFile-implementation?

kimruben
User offline. Last seen 4 years 11 weeks ago. Offline
Joined: 23 May 2011

Just to clarify here..

When the media.show() is called, I get a dialog with 2 choices..
"DropBox" and "Gallery"

When tapping the Gallery icon, I am presented a "Gallery" with various images.
I don't use this phone for everyday use, it's only a test/dev device.
But I have use Google+ and stuff on it.

So what I see is 3 folders that, for me, is intuitively marked as on device folders.
And lots of folders with the small Picasa icon on them, like Instant Uploads etc.
These are images that come from Google+ and various other places. Not taken on this device.

Joshua Quick
User offline. Last seen 52 weeks 1 hour ago. Offline
Staff
Joined: 31 Jan 2011

That 2 choice Gallery and Drop Box prompt appears to be new. I had to update the OS on my Galaxy SIII today to get it to show me that option. But that said, Corona we'll need to support it and "keep up" with Android's changes.

I'm working on the photo selection issue now. I've managed to get it to work with Picasa, Drop Box, and local photos from the Gallery app so far. I'll have to do some more testing tomorrow on several other devices and with Google+ and SkyDrive... but if all goes well, I should have a solution for you guys by the end of this week.

haakon
User offline. Last seen 3 years 31 weeks ago. Offline
Joined: 19 Jan 2011

Excellent news, Joshua! Thank you! :) That's going to help tremendously on the Crittercism exceptions and user tickets for us.

Just discovered one thing yesterday. Remember that I pointed out that there's a dependency in libplayer.a on Facebook? Theres something equally strange in the Android version. Even though we're not referencing or using Flurry, Inneractive or Inmobi, dex files are still being created and added to the final build. We're not fans of adding stuff that's not in use, it'd be better if you dropped all such dependencies and made it possible for us to add on demand. Is it possible?

Joshua Quick
User offline. Last seen 52 weeks 1 hour ago. Offline
Staff
Joined: 31 Jan 2011

This media.show() issue with remote images is now fixed. Our newest changes can now successfully open images from Picasa, Google+, SkyDrive, and DropBox. This fix will be made available in daily build #1041.

Regarding the Facebook, Flurry, and other libraries that you see within Corona's dex file, those are just Corona's thin plugin interfaces to those 3rd party libraries. They won't do any harm. In fact, they belong to the JAR files that you see in the following directory...
> CoronaEnterprise/Corona/android/lib/Corona/libs

If you don't like their inclusion at the moment, then you can try removing those JAR files from Corona's "libs" directory yourself. That will exclude their classes from the final build. I haven't tested their exclusion from Corona for myself, but I'm pretty sure as long as you never require those features, then they won't do any harm.

Our plugin support on Android is still very new and being actively worked on, meaning we still have some cleanup to do and we'll likely make these libraries optional. In fact, our first real guinea pig with an "optional" Android plugin will be the upcoming Green Throttle. So, I would expect some Enterprise plugin changes sometime later this month.

Anyways, I hope this helps!

Joshua Quick
User offline. Last seen 52 weeks 1 hour ago. Offline
Staff
Joined: 31 Jan 2011

Oh right, and I believe the iOS team completely removed facebook references from Corona Enterprise for iOS in daily build #1038...
http://developer.coronalabs.com/release-ent/2013/1038

kimruben
User offline. Last seen 4 years 11 weeks ago. Offline
Joined: 23 May 2011

1041 works like a charm with regards to images from different sources.
Thanks Joshua! :)

Viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.