yasirkula / UnityNativeGallery

A native Unity plugin to interact with Gallery/Photos on Android & iOS (save and/or load images/videos)
MIT License
1.42k stars 199 forks source link

Accessing the album api crashes #274

Closed April-studio closed 1 year ago

April-studio commented 1 year ago

Fatal Exception: java.lang.Error: FATAL EXCEPTION [main] Unity version : 2020.3.40f1 Device model : motorola moto g(6) Device fingerprint: motorola/ali/ali:9/PPSS29.55-37-7-10/c25e:user/release-keys Build Type : Release Scripting Backend : IL2CPP ABI : armeabi-v7a Strip Engine Code : true

Caused by java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState at android.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1877) at android.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1900) at android.app.BackStackRecord.commitInternal(BackStackRecord.java:688) at android.app.BackStackRecord.commit(BackStackRecord.java:646) at android.app.DialogFragment.dismissInternal(DialogFragment.java:306) at android.app.DialogFragment.dismiss(DialogFragment.java:272) at com.yasirkula.unity.NativeGalleryMediaPickerResultFragment$1.run(NativeGalleryMediaPickerResultFragment.java:35) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6923) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:870)

when user accessing the album,the app will be crash,how to fix it.

yasirkula commented 1 year ago

Can you replace NativeGallery.aar with the one inside this zip archive and try again?

April-studio commented 1 year ago

yes i can replace it and try again.sorry to ask, is this different from the 1.7.1 version? I have downloaded the latest version.

yasirkula commented 1 year ago

Yes I've modified the native source code to hopefully resolve this issue.

April-studio commented 1 year ago

Thank you for your contribution, I will give feedback later