nguyenhoanglam / ImagePicker

A customizable library for selecting images on the device.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crashing on Android 13

dozy-programmer opened this issue · comments

commented

I am seeing a recurring crash for Android 13 devices.

Fatal Exception: java.lang.RuntimeException
Unable to start activity ComponentInfo{com.example.myapp/com.nguyenhoanglam.imagepicker.ui.imagepicker.ImagePickerActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Class.isInterface()' on a null object reference

I am not able to dig much deeper, since none of the users have reached out, but maybe @nguyenhoanglam has an idea on how this might be possible?

Edit: Was able to dig a little deeper

// this line is what is causing the crashing
config = if (DeviceHelper.isMinSdk33) intent.getParcelableExtra(
            Constants.EXTRA_CONFIG, ImagePickerConfig::class.java
        )!! else intent.getParcelableExtra(Constants.EXTRA_CONFIG)!!
        config.initDefaultValues(this@ImagePickerActivity)

File at com.nguyenhoanglam.imagepicker.ui.imagepicker.ImagePickerActivity.onCreate (ImagePickerActivity.kt:94)

@dozy-programmer look like this is a bug of Parcelable .

https://stackoverflow.com/questions/75953723/android-intent-getparcelablearraylistextra-on-arraylistlatlng-raises-nullpoint

I've just reverted the code to use the old methods. Please check 1.6.3 and let me know if it's fixed. Thanks!

commented

thanks @nguyenhoanglam, I will let you know if users are still having issues. Appreciate the fix!

commented

Issue completely fixed, thanks!