Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: App crash when image is picked from gallery which is downloaded from hangout. #60

Open
jkpatel1463 opened this issue Sep 14, 2017 · 0 comments

Comments

@jkpatel1463
Copy link

Hello

App Crashed due to images from hangout and Google photos are displayed while opening Gallery for image picking.

Code:

public function pickImage(callback:Function, cropping:Boolean = false):void
{
	trace("ImagePickHelper - pickImage: " + AirImagePicker.instance.getGalleryPermissionStatus().value);
	if (AirImagePicker.instance.getGalleryPermissionStatus() ==AirImagePickerPermissionStatus.DENIED 
		|| AirImagePicker.instance.getGalleryPermissionStatus() ==AirImagePickerPermissionStatus.RESTRICTED){
		callback(AirImagePickerRecentImagesEvent.PERMISSION_ERROR);
		return;
		}
	_callback = callback;
	AirImagePicker.instance.displayImagePicker(-1, -1, cropping);
}
		

Stack trace:

09-14 11:27:24.335 11400-11400/? D/AirImagePicker: [ImagePickerActivityBase] Entering onCreate
09-14 11:27:24.335 11400-11400/? D/AirImagePicker: [ImagePickerActivityBase] my package name:air.APP_PACKAGE_ID
09-14 11:27:24.340 11400-11400/? D/AirImagePicker: [ImagePickerActivityBase] Exiting onCreate
09-14 11:27:24.390 11400-11400/? I/air.APP_PACKAGE_ID: [AirImagePicker] GalleryActivity
09-14 11:27:28.320 11400-11400/? D/AirImagePicker: [ImagePickerActivityBase] Entering onCreate
09-14 11:27:28.320 11400-11400/? D/AirImagePicker: [ImagePickerActivityBase] my package name:air.APP_PACKAGE_ID
09-14 11:27:28.320 11400-11400/? D/AirImagePicker: [ImagePickerActivityBase] Exiting onCreate
09-14 11:27:28.475 11400-11400/? D/AirImagePicker: [AirImagePickerUtils] Entering getOrientedSampleBitmapFromPath
09-14 11:27:28.475 11400-11400/? E/AirImagePicker: [AirImagePickerUtils] Couldn't decode file:https://lh3.googleusercontent.com/PATH_OF_THE_IMAGE_IN_GOOGLE.jpg
09-14 11:27:28.475 11400-11400/? D/AirImagePicker: [AirImagePickerUtils] Entering resizeImage: -1 x -1
09-14 11:27:28.490 11400-11400/? E/AndroidRuntime: FATAL EXCEPTION: main
                                                   java.lang.RuntimeException: Unable to resume activity {air.APP_PACKAGE_ID/com.freshplanet.ane.AirImagePicker.activities.GalleryActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=0, result=-1, data=Intent { dat=content://com.sec.android.gallery3d.provider/picasa/item/6340169600424824898 (has extras) }} to activity {air.APP_PACKAGE_ID/com.freshplanet.ane.AirImagePicker.activities.GalleryActivity}: java.lang.NullPointerException
                                                       at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2919)
                                                       at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2948)
                                                       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2354)
                                                       at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3877)
                                                       at android.app.ActivityThread.access$800(ActivityThread.java:159)
                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1322)
                                                       at android.os.Handler.dispatchMessage(Handler.java:99)
                                                       at android.os.Looper.loop(Looper.java:176)
                                                       at android.app.ActivityThread.main(ActivityThread.java:5419)
                                                       at java.lang.reflect.Method.invokeNative(Native Method)
                                                       at java.lang.reflect.Method.invoke(Method.java:525)
                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
                                                       at dalvik.system.NativeStart.main(Native Method)
                                                    Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=0, result=-1, data=Intent { dat=content://com.sec.android.gallery3d.provider/picasa/item/6340169600424824898 (has extras) }} to activity {air.APP_PACKAGE_ID/com.freshplanet.ane.AirImagePicker.activities.GalleryActivity}: java.lang.NullPointerException
                                                       at android.app.ActivityThread.deliverResults(ActivityThread.java:3500)
                                                       at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2906)
                                                       at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2948) 
                                                       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2354) 
                                                       at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3877) 
                                                       at android.app.ActivityThread.access$800(ActivityThread.java:159) 
                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1322) 
                                                       at android.os.Handler.dispatchMessage(Handler.java:99) 
                                                       at android.os.Looper.loop(Looper.java:176) 
                                                       at android.app.ActivityThread.main(ActivityThread.java:5419) 
                                                       at java.lang.reflect.Method.invokeNative(Native Method) 
                                                       at java.lang.reflect.Method.invoke(Method.java:525) 
                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046) 
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862) 
                                                       at dalvik.system.NativeStart.main(Native Method) 
                                                    Caused by: java.lang.NullPointerException
                                                       at com.freshplanet.ane.AirImagePicker.AirImagePickerUtils.resizeImage(AirImagePickerUtils.java:212)
                                                       at com.freshplanet.ane.AirImagePicker.activities.GalleryActivity.onActivityResult(GalleryActivity.java:61)
                                                       at android.app.Activity.dispatchActivityResult(Activity.java:5563)
                                                       at android.app.ActivityThread.deliverResults(ActivityThread.java:3496)
                                                       at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2906) 
                                                       at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2948) 
                                                       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2354) 
                                                       at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3877) 
                                                       at android.app.ActivityThread.access$800(ActivityThread.java:159) 
                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1322) 
                                                       at android.os.Handler.dispatchMessage(Handler.java:99) 
                                                       at android.os.Looper.loop(Looper.java:176) 
                                                       at android.app.ActivityThread.main(ActivityThread.java:5419) 
                                                       at java.lang.reflect.Method.invokeNative(Native Method) 
                                                       at java.lang.reflect.Method.invoke(Method.java:525) 
                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046) 
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862) 
                                                       at dalvik.system.NativeStart.main(Native Method) 

Steps to reproduce:

  1. Tap on button to open Image picker
  2. Display all images which is in the gallery as well as in hangout album
  3. Click on the hangout album
  4. Click on the images from that album
    App crashed

Possible solutions:

  • don't list out those all album which have such images
  • try to decode the image from url as well

Device: Samsung Galaxy S III
Os:Android 4.3
Device Link: http://www.gsmarena.com/samsung_i9300_galaxy_s_iii-4238.php

from my point of view second solution will give best user experienced, so started working on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant