yasirkula / UnitySimpleFileBrowser

A uGUI based runtime file browser for Unity 3D (draggable and resizable)
MIT License
851 stars 111 forks source link

Exception - UnityEngine.AndroidJavaException: java.lang.ClassNotFoundException: com.yasirkula.unity.FileBrowserPermissionReceiver #33

Closed DigitalMaster37 closed 3 years ago

DigitalMaster37 commented 3 years ago

I am getting the above error when using the example code provided. The exception is hit when running the yield return FileBrowser.WaitForLoadDialog(false, true, null, "Load File", "Load");

It is worth noting that the same works when I test on desktop, but when I build this and run on my Android phone (Note 10), it hits this error.

Can you please advise on what I could do to overcome this issue?

yasirkula commented 3 years ago

If your project uses ProGuard, try adding the following line to ProGuard filters: -keep class com.yasirkula.unity.* { *; }

DigitalMaster37 commented 3 years ago

First, thanks for the quick reply! However, I don't use proguard, or at least I have no idea that if I do or not as I have not explicitly installed or chosen to use it. How do we check that?

DigitalMaster37 commented 3 years ago

So maybe I do use it as my program file size is larger than most and it is available on the play store. Do you have any guidance on how to add that filter? I have no idea how to interact with ProGuard in unity

yasirkula commented 3 years ago

You can see ProGuard in Player Settings-Minification. This plugin doesn't support Gradle minification so if it is selected, you should change it to either None or ProGuard. Then enable User Proguard File and add the line to that file. I haven't used ProGuard myself so I don't know exactly where in that file you should paste the line.

DigitalMaster37 commented 3 years ago

YOu rock, this worked like a charm. As you recommended, I just created that custom proguard file and just added the text as-is that you provided. It is working. Thank you very much!!! Great asset

yasirkula commented 3 years ago

Happy to hear that 😄