Open rilla1537 opened 4 weeks ago
Asset Store version doesn't include this fix so can you update from GitHub instead? https://github.com/yasirkula/UnityNativeGallery?tab=readme-ov-file#installation
I'll update Asset Store soon.
PS. You're already copying the image to persistentDataPath so you actually don't need this fix at all. You can delete the Awake function.
Also I'd recommend using UnityWebRequestTexture because that's what Unity recommends over WWW, as well.
PS. Actually use NativeGallery.LoadImageAtPath instead (it has an async variant as well) because it supports more image formats than WWW or UnityWebRequestTexture. Don't forget to set markTextureNonReadable parameter to false otherwise EncodeToPNG won't work.
Description of the bug
I read the documentation and used persistentDataPath, but I encountered this error. I downloaded the plugin from the Asset Store. For reference, simply retrieving the photo worked without any issues.
Reproduction steps `using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using System.IO; using NativeGalleryNamespace;
public class SceneManager : MonoBehaviour { public Image imageUI; // Canvas의 Image 컴포넌트 연결 private string savedImagePath;
if !UNITY_EDITOR && UNITY_ANDROID
endif
} `
Platform specs
Please provide the following info if this is a Unity 3D repository.
Additional info
2024-08-16 22:43:51.056 31025 31054 Error Unity AndroidJavaException: java.lang.NoSuchFieldError: no "Z" field "GrantPersistableUriPermission" in class "Lcom/yasirkula/unity/NativeGalleryMediaPickerFragment;" or its superclasses 2024-08-16 22:43:51.056 31025 31054 Error Unity java.lang.NoSuchFieldError: no "Z" field "GrantPersistableUriPermission" in class "Lcom/yasirkula/unity/NativeGalleryMediaPickerFragment;" or its superclasses 2024-08-16 22:43:51.056 31025 31054 Error Unity at com.unity3d.player.UnityPlayer.nativeRender(Native Method) 2024-08-16 22:43:51.056 31025 31054 Error Unity at com.unity3d.player.UnityPlayer.-$$Nest$mnativeRender(Unknown Source:0) 2024-08-16 22:43:51.056 31025 31054 Error Unity at com.unity3d.player.UnityPlayer$F$a.handleMessage(Unknown Source:122) 2024-08-16 22:43:51.056 31025 31054 Error Unity at android.os.Handler.dispatchMessage(Handler.java:102) 2024-08-16 22:43:51.056 31025 31054 Error Unity at android.os.Looper.loopOnce(Looper.java:230) 2024-08-16 22:43:51.056 31025 31054 Error Unity at android.os.Looper.loop(Looper.java:319) 2024-08-16 22:43:51.056 31025 31054 Error Unity at com.unity3d.player.UnityPlayer$F.run(Unknown Source:24) 2024-08-16 22:43:51.056 31025 31054 Error Unity at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <00000000000000000000000000000000>:0 2024-08-16 22:43:51.056 31025 31054 Error Unity at UnityEngine.AndroidJNISafe.GetStaticFieldID (System.IntPtr clazz, System.String name, System.String sig) [0x00000] in <00000000000000000000000000000000>:0 2024-08-16 22:43:51.056 31025 31054 Error Unity