yasirkula / UnityNativeGallery

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

Android: NoSuchMethodError no static method with name='RequestPermission' #245

Open gipger opened 2 years ago

gipger commented 2 years ago

After calling NativeGallery.SaveImageToGallery method an error has occurred on Android:

AndroidJavaException: java.lang.NoSuchMethodError: no static method with name='RequestPermission' signature='(Lcom.inmoso.new3dcar.FormacarUnityPlayerActivity;Lcom.yasirkula.unity.NativeGalleryPermissionReceiver;ZI)V' in class Ljava.lang.Object; java.lang.NoSuchMethodError: no static method with name='RequestPermission' signature='(Lcom.inmoso.new3dcar.FormacarUnityPlayerActivity;Lcom.yasirkula.unity.NativeGalleryPermissionReceiver;ZI)V' in class Ljava.lang.Object; at com.unity3d.player.ReflectionHelper.getMethodID(Unknown Source:162) at com.unity3d.player.UnityPlayer.nativeRender(Native Method) at com.unity3d.player.UnityPlayer.access$300(Unknown Source:0) at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95) at android.os.Handler.dispatchMessage(Handler.java:103) at android.os.Looper.loop(Looper.java:224) at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20) at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.And

Reproduction steps:

1) Call NativeGallery.SaveImageToGallery(screenShot, "Screenshots", "My img {0}.png");

Platform specs:

yasirkula commented 2 years ago

If you haven't imported the plugin recently, please try deleting it and reimporting it from scratch. Also see the Proguard related FAQ entry and if you've modified the plugin in any way, please let me know.