GeezerVison is showing github.com — ClassNotFoundException: com.yasirkula.unity.NativeFilePickerPermissionReceiver · Issue #31 · yasirkula/UnityNativeFilePicker
ClassNotFoundException: com.yasirkula.unity.NativeFilePickerPermissionReceiver #31
Labels
bugSomething isn't working Description
Description of the bug
I tried using the Asset Store version of the plugin, and downloading from this repo.
When I try to trigger the file-picker on Android, I get the following error:
public void promptUserFilePicker()
{
#if UNITY_ANDROID
// Use MIMEs on Android
string[] fileTypes = new string[] { "video/*" };
#else
// Use UTIs on iOS
string[] fileTypes = new string[] { "public.movie" };
#endif
// Pick image(s) and/or video(s)
NativeFilePicker.Permission permission = NativeFilePicker.PickFile((path) =>
{
if (path == null)
Debug.Log("Operation cancelled");
else
{
Debug.Log("Picked file: " + path);
Open(path);
}
}, fileTypes);
_ShowAndroidToastMessage($"Permission result: {permission}");
Debug.Log("Permission result: " + permission);
}
Reproduction steps
If possible, providing reproduction steps would be very helpful while pinpointing the issue. You can also post screenshots if you think they would be helpful.
Platform specs
Please provide the following info if this is a Unity 3D repository.
- Unity version: 2021.3.11f1*
- Platform: Android
- Device: Samsung Galaxy S10 5G UW, SM-G981V, Android 12, One UI 4.1
- How did you download the plugin: tried Asset Store, and Github
12-01 18:12:46.955: E/Unity(19439): AndroidJavaException: java.lang.ClassNotFoundException: com.yasirkula.unity.NativeFilePickerPermissionReceiver
12-01 18:12:46.955: E/Unity(19439): java.lang.ClassNotFoundException: com.yasirkula.unity.NativeFilePickerPermissionReceiver
12-01 18:12:46.955: E/Unity(19439): at java.lang.Class.classForName(Native Method)
12-01 18:12:46.955: E/Unity(19439): at java.lang.Class.forName(Class.java:454)
12-01 18:12:46.955: E/Unity(19439): at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
12-01 18:12:46.955: E/Unity(19439): at com.unity3d.player.UnityPlayer.access$300(Unknown Source:0)
12-01 18:12:46.955: E/Unity(19439): at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95)
12-01 18:12:46.955: E/Unity(19439): at android.os.Handler.dispatchMessage(Handler.java:102)
12-01 18:12:46.955: E/Unity(19439): at android.os.Looper.loopOnce(Looper.java:226)
12-01 18:12:46.955: E/Unity(19439): at android.os.Looper.loop(Looper.java:313)
12-01 18:12:46.955: E/Unity(19439): at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
12-01 18:12:46.955: E/Unity(19439): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.yasirkula.unity.NativeFilePickerPermissionReceiver" on path: DexPathList[[zip file "/data/app/~~2SxF3bRkAF4GEX2SPy-XmA==/com.jakedowns.nrealDemo-zZGyxBZwlPgN4jf7VdhXbw==/base.apk"],nativeLibraryDirectories=[/data/app/~~2SxF3bRkAF4GEX2SPy-XmA==/com.jakedow
Activity
yasirkula commented on Dec 2, 2022
Looks like the class is stripped but I don't know how because the embedded Proguard file specifically tells the Gradle compiler not to strip any of the classes. I don't believe you can reproduce this issue on a new project, so something is interfering with Gradle build pipeline in a way I'm unfamiliar with.
jakedowns commented on Dec 2, 2022
Ah, thank you, that was the issue, added to my Exported proguard-unity.txt
-keep class com.yasirkula.unity.* { *; }
Metadata
Metadata
bugSomething isn't working Development
No branches or pull requestsIssue actions