Last modified: 2012-08-30 18:46:15 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T41604, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 39604 - Selecting photo from picasa in my gallery causes app to crash
Selecting photo from picasa in my gallery causes app to crash
Status: RESOLVED FIXED
Product: WikiLoves Monuments Mobile
Classification: Unclassified
Upload (Other open bugs)
unspecified
All All
: Low minor
: ---
Assigned To: Brion Vibber
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-24 00:31 UTC by Arthur Richards
Modified: 2012-08-30 18:46 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Arthur Richards 2012-08-24 00:31:57 UTC
To reproduce:
* Select to upload a photo for a monument
* Select to upload photo from gallery
* Select a photo from picassa in you gallery

App crashes :(
Comment 1 Arthur Richards 2012-08-24 00:39:08 UTC
PS this is happening on my Galaxy Nexus running Android 4.0.4
Comment 2 Brion Vibber 2012-08-24 18:26:42 UTC
Are you using some Picasa app to provide access in the gallery? If so, which? There seem to be a bunch and I'm not sure which is official etc.
Comment 3 Arthur Richards 2012-08-24 19:01:28 UTC
Hrm not that I know of, I assumed it was just a fancy ICS feature. I'll dig a little more.
Comment 4 Arthur Richards 2012-08-24 19:14:14 UTC
Yeah, I believe this happens automagically because I have 'Sync Google Photos' enabled in my account sync settings.
Comment 5 Brion Vibber 2012-08-29 03:33:53 UTC
I downloaded Picasa to my Mac, synced a few photos up to Google, and tried selecting one from gallery. Can confirm the crash on my Galaxy Nexus also running Android 4.0.4. :(

08-28 22:29:42.361: E/ActivityThread(5838): Activity com.android.internal.app.ChooserActivity has leaked IntentReceiver com.android.internal.app.ResolverActivity$1@41870528 that was originally registered here. Are you missing a call to unregisterReceiver()?
08-28 22:29:42.361: E/ActivityThread(5838): android.app.IntentReceiverLeaked: Activity com.android.internal.app.ChooserActivity has leaked IntentReceiver com.android.internal.app.ResolverActivity$1@41870528 that was originally registered here. Are you missing a call to unregisterReceiver()?
08-28 22:29:42.361: E/ActivityThread(5838): 	at android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.java:763)
08-28 22:29:42.361: E/ActivityThread(5838): 	at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:567)
08-28 22:29:42.361: E/ActivityThread(5838): 	at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1043)
08-28 22:29:42.361: E/ActivityThread(5838): 	at android.app.ContextImpl.registerReceiver(ContextImpl.java:1030)
08-28 22:29:42.361: E/ActivityThread(5838): 	at android.app.ContextImpl.registerReceiver(ContextImpl.java:1024)
08-28 22:29:42.361: E/ActivityThread(5838): 	at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:341)
08-28 22:29:42.361: E/ActivityThread(5838): 	at com.android.internal.content.PackageMonitor.register(PackageMonitor.java:65)
08-28 22:29:42.361: E/ActivityThread(5838): 	at com.android.internal.app.ResolverActivity.onCreate(ResolverActivity.java:99)
08-28 22:29:42.361: E/ActivityThread(5838): 	at com.android.internal.app.ChooserActivity.onCreate(ChooserActivity.java:53)
08-28 22:29:42.361: E/ActivityThread(5838): 	at android.app.Activity.performCreate(Activity.java:4465)
08-28 22:29:42.361: E/ActivityThread(5838): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
08-28 22:29:42.361: E/ActivityThread(5838): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
08-28 22:29:42.361: E/ActivityThread(5838): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
08-28 22:29:42.361: E/ActivityThread(5838): 	at android.app.ActivityThread.access$600(ActivityThread.java:123)
08-28 22:29:42.361: E/ActivityThread(5838): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
08-28 22:29:42.361: E/ActivityThread(5838): 	at android.os.Handler.dispatchMessage(Handler.java:99)
08-28 22:29:42.361: E/ActivityThread(5838): 	at android.os.Looper.loop(Looper.java:137)
08-28 22:29:42.361: E/ActivityThread(5838): 	at android.app.ActivityThread.main(ActivityThread.java:4424)
08-28 22:29:42.361: E/ActivityThread(5838): 	at java.lang.reflect.Method.invokeNative(Native Method)
08-28 22:29:42.361: E/ActivityThread(5838): 	at java.lang.reflect.Method.invoke(Method.java:511)
08-28 22:29:42.361: E/ActivityThread(5838): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
08-28 22:29:42.361: E/ActivityThread(5838): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
08-28 22:29:42.361: E/ActivityThread(5838): 	at dalvik.system.NativeStart.main(Native Method)
08-28 22:29:46.377: D/AndroidRuntime(5838): Shutting down VM
08-28 22:29:46.377: W/dalvikvm(5838): threadid=1: thread exiting with uncaught exception (group=0x40a251f8)
08-28 22:29:46.385: E/AndroidRuntime(5838): FATAL EXCEPTION: main
08-28 22:29:46.385: E/AndroidRuntime(5838): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=18, result=-1, data=Intent { dat=content://com.google.android.gallery3d.provider/picasa/item/5781931205767864146 }} to activity {org.wikipedia.wlm/org.wikipedia.wlm.WikiLovesMonuments}: java.lang.NullPointerException
08-28 22:29:46.385: E/AndroidRuntime(5838): 	at android.app.ActivityThread.deliverResults(ActivityThread.java:2980)
08-28 22:29:46.385: E/AndroidRuntime(5838): 	at android.app.ActivityThread.handleSendResult(ActivityThread.java:3023)
08-28 22:29:46.385: E/AndroidRuntime(5838): 	at android.app.ActivityThread.access$1100(ActivityThread.java:123)
08-28 22:29:46.385: E/AndroidRuntime(5838): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1177)
08-28 22:29:46.385: E/AndroidRuntime(5838): 	at android.os.Handler.dispatchMessage(Handler.java:99)
08-28 22:29:46.385: E/AndroidRuntime(5838): 	at android.os.Looper.loop(Looper.java:137)
08-28 22:29:46.385: E/AndroidRuntime(5838): 	at android.app.ActivityThread.main(ActivityThread.java:4424)
08-28 22:29:46.385: E/AndroidRuntime(5838): 	at java.lang.reflect.Method.invokeNative(Native Method)
08-28 22:29:46.385: E/AndroidRuntime(5838): 	at java.lang.reflect.Method.invoke(Method.java:511)
08-28 22:29:46.385: E/AndroidRuntime(5838): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
08-28 22:29:46.385: E/AndroidRuntime(5838): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
08-28 22:29:46.385: E/AndroidRuntime(5838): 	at dalvik.system.NativeStart.main(Native Method)
08-28 22:29:46.385: E/AndroidRuntime(5838): Caused by: java.lang.NullPointerException
08-28 22:29:46.385: E/AndroidRuntime(5838): 	at org.apache.cordova.CameraLauncher.onActivityResult(CameraLauncher.java:453)
08-28 22:29:46.385: E/AndroidRuntime(5838): 	at org.apache.cordova.DroidGap.onActivityResult(DroidGap.java:823)
08-28 22:29:46.385: E/AndroidRuntime(5838): 	at android.app.Activity.dispatchActivityResult(Activity.java:4649)
08-28 22:29:46.385: E/AndroidRuntime(5838): 	at android.app.ActivityThread.deliverResults(ActivityThread.java:2976)
08-28 22:29:46.385: E/AndroidRuntime(5838): 	... 11 more
Comment 6 Brion Vibber 2012-08-29 03:58:28 UTC
It looks like the method Cordova uses to look up the raw file path from the content database entry doesn't work on Picasa album entries.

In FileUtils.getRealPathFromURI() it's trying to look up a "_data" column from the content provider, which in regular items seems to be a filesystem path, but it doesn't exist in the Picasa entry.

So, we start with a URI like this: content://com.google.android.gallery3d.provider/picasa/item/5781931205767864146 and get back NULL for the path. This leads to being unable to load the bitmap image, and things explode when the camera result handling code in CameraLauncher.onActivityResult tries to discard the bitmap. :P


I can get past the crash by wrapping the bitmap.recycle() in CameraLauncher.java:

		        if (bitmap != null) {
	                        bitmap.recycle();
	                    }

however it ends up hanging when I try to actually upload, so doesn't seem like a huge improvement.
Comment 7 Brion Vibber 2012-08-29 04:05:53 UTC
Filed an upstream bug with Cordova:
https://issues.apache.org/jira/browse/CB-1293
Comment 8 Jon 2012-08-30 16:31:04 UTC
Are we able to use a patched version for the app?
Comment 9 Brion Vibber 2012-08-30 18:25:24 UTC
I can whip up a patched version to not crash, but uploading the picture doesn't work for some reason...

Might be able to rig it to reject the photo, lemme try real quick.
Comment 10 Brion Vibber 2012-08-30 18:37:38 UTC
This patches Cordova to return an error, and patches our app to show an error dialog in this failure case:

https://github.com/wikimedia/WLMMobile/pull/219
Comment 11 Arthur Richards 2012-08-30 18:46:15 UTC
I think this sufficient for now, thanks!

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links