Can't get SelectedMediaPath,
` E Media uri isn't accessible via File API: content://com.miui.gallery.open/raw/%2Fstorage%2Femulated%2F0%2FDCIM%2FScreenshots%2FScreenshot_2025-02-19-11-54-02-286_com.miui.home.jpg
java.io.FileNotFoundException: /storage/emulated/0/DCIM/Screenshots/Screenshot_2025-02-19-11-54-02-286_com.miui.home.jpg: open failed: EACCES (Permission denied)
at libcore.io.IoBridge.open(IoBridge.java:574)
at java.io.FileInputStream.
`
After this error occurs, file is copied to temporaryCachePath and its path is returned instead: https://github.com/yasirkula/UnityNativeGallery/blob/4d27475bed66d56aca8b7d585b98fe503525e593/.github/AAR%20Source%20(Android)/java/com/yasirkula/unity/NativeGalleryMediaPickerResultOperation.java#L166
Are you not receiving a path at all? If so, are there other error messages after this one?
Hi. I have this problem too. I need to retrieve the image name. It returns this as a Path, but the "pickedMedia" is not the image name. /storage/emulated/0/Android/data/com.Map.Map/cache/pickedMedia.jpg
@ayob-aazami Try this in Awake:
#if !UNITY_EDITOR && UNITY_ANDROID
using( AndroidJavaClass ajc = new AndroidJavaClass( "com.yasirkula.unity.NativeGalleryMediaPickerFragment" ) )
ajc.SetStatic<bool>( "tryPreserveFilenames", true );
#endif
Though read the comment first: https://github.com/yasirkula/UnityNativeGallery/blob/4d27475bed66d56aca8b7d585b98fe503525e593/.github/AAR%20Source%20(Android)/java/com/yasirkula/unity/NativeGalleryMediaPickerFragment.java#L30