nguyenhoanglam / ImagePicker

A customizable library for selecting images on the device.
Apache License 2.0
595 stars 157 forks source link

Android 13 & 14 Crashes + Android 12 #161

Open dozy-programmer opened 4 months ago

dozy-programmer commented 4 months ago

Hello again, Thanks for fixing the last issue I reported. I have not had that issue since. Also wanted to say thanks for making this library, as it is very useful and customizable (UI and codewise).

I have been noticing an issue in ImagePickerActivity(line 94) and CameraActivity(line 61). It is the same issue and a good amount of devices are crashing as a result. Good thing is that I am able to pinpoint it to this line. config = intent.getParcelableExtra(Constants.EXTRA_CONFIG)!! I noticed that getParcelableExtra is deprecated starting Android 13 and the issues are mostly occurring on that OS. Not sure if maybe Android 13 is handling this differently and crashing as a result?

Also wanted to add that on most devices, this is not an issue. It is working on my Oneplus Android 14. On the other hand, the Nothing phone on Android 14 is crashing.

nguyenhoanglam commented 4 months ago

@dozy-programmer could you send me the crash log detail?

dozy-programmer commented 4 months ago

@nguyenhoanglam sure, not sure that is going to help much. I am also attaching a video a user gave me that results in the issue specified (when user clicks on Storage button in my app, it routes to your image picker library). Looking at the video I am attaching, I see the usual Photos and Videos permission is not an option? Not sure why that is the case since I specified the correct permissions.

Caused by java.lang.NullPointerException: at com.nguyenhoanglam.imagepicker.ui.imagepicker.ImagePickerActivity.onCreate(ImagePickerActivity.kt:94) at android.app.Activity.performCreate(Activity.java:8595) at android.app.Activity.performCreate(Activity.java:8573) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1476) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3815) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3973) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2474) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:232) at android.os.Looper.loop(Looper.java:334) at android.app.ActivityThread.main(ActivityThread.java:8291) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:557) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:981)

https://github.com/nguyenhoanglam/ImagePicker/assets/33325959/fab72a1c-9423-48c2-9fa3-1d6a41345259

sharjeelmuzaffar commented 2 months ago

@nguyenhoanglam I am facing the same issue please help me out in android 13 and 14

dozy-programmer commented 2 months ago

@sharjeelmuzaffar Seems like Android is really pushing their Photo picker. See https://developer.android.com/training/data-storage/shared/photopicker.

I would rather not keep having these issues and will just move on to use that. Issue also persists in Android 12.

Thanks for taking the time to create this library and appreciate the help @nguyenhoanglam.

sharjeelmuzaffar commented 2 months ago

okh thank you so much for your support

On Fri, May 17, 2024 at 6:52 AM Amar @.***> wrote:

@sharjeelmuzaffar https://github.com/sharjeelmuzaffar Seems like Android is really pushing their Photo picker. See https://developer.android.com/training/data-storage/shared/photopicker.

I would rather not keep having these issues and will just move on to use that. Issue also persists in Android 12.

— Reply to this email directly, view it on GitHub https://github.com/nguyenhoanglam/ImagePicker/issues/161#issuecomment-2116486107, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANF2P3L5MZS6TBQJWQEMDCDZCVPGJAVCNFSM6AAAAABEZW7ODKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJWGQ4DMMJQG4 . You are receiving this because you were mentioned.Message ID: @.***>