react-native-image-crop-picker
react-native-image-crop-picker copied to clipboard
Still need requestLegacyExternalStorage="true" if targetSdkVersion = 29
Version
Tell us which versions you are using:
- react-native-image-crop-picker v0.35.1
- react-native v0.62.2
Platform
Tell us to which platform this issue is related
Android
Expected behaviour
ImagePicker.openPicker() should return the selected image information.
Actual behaviour
Returns error code E_NO_IMAGE_DATA_FOUND
and error message Invalid image selected
on some devices
This problem start to happen after we upgrading targetSdkVersion from 28 to 29. And it mostly happened on Android 10 devices, but not all Android 10 devices will have this problem. Here are some devices our customers have ever experienced this problem:
Xiaomi Mi 9T Xiaomi MI 8 Pro samsung SM-A505GN samsung SM-G986B samsung SM-A307GN samsung SM-G9650 samsung SM-G960F samsung SM-A7050 samsung SM-N9860 realme RMX1921 realme RMX2144 vivo vivo 1920 vivo vivo 1935 HTC HTC Desire 20 Pro OPPO CPH1941 HUAWEI LIO-L29 HUAWEI LYA-L29 asus ASUS_I01WD
After adding the android:requestLegacyExternalStorage="true" to AndroidManifest.xml, the problem is gone. Therefore, it seems 1ddd03e released in react-native-image-crop-picker 0.29.0 does not solve all issues related to new SDK 29 permission model completely?
This need to be fixed as the this workaround will no longer work if you target SDK 30.
Steps to reproduce
-
set targetSdkVersion to 29 and don’t set requestLegacyExternalStorage in AndroidManifest.xml
-
call ImagePicker.openPicker()
-
some devices will return error E_NO_IMAGE_DATA_FOUND instead of the selected photo information
@howg0924 what is the error message you are getting? Invalid image selected
?
@superandrew213 Yes, the error message is Invalid image selected
.
Do you know what caused this? Thanks a lot~~~.
It seems 1ddd03e only solved the issue of writing the temp output image file on new SDK 29 permission model.
Maybe just as this article said:
https://medium.com/@sriramaripirala/android-10-open-failed-eacces-permission-denied-da8b630a89df
react-native-image-crop-picker also need to change its way when fetching the source image?
Not sure.
Adding android:requestLegacyExternalStorage="true"
fixes it but not for all users. Some users still get this issue on SDK29.
Will try v035.2
.
I am not getting android:requestLegacyExternalStorage="true"
even SDK version 29, still facing issue in Xiaomi 8a dual phone, openPicker is working fine, but on openCamera after click image, it goes back to the splash screen.
help with this.
Same problem here, some users can't select the image and cellphone crashes, any help?
android:requestLegacyExternalStorage="true"
Will be not working on Android 11. Have any suggest to solve it?
@sinhpn92 link this may help
Until this is fixed: Has anyone tried setting preserveLegacyExternalStorage=true
?
Until this is fixed: Has anyone tried setting
preserveLegacyExternalStorage=true
?
As far as I understand it, this flag is only to enable data migration when the users upgrades from Android 10 to 11. So it should have nothing to do with access / scope management itself, but rather merge old (non-scoped) data to the new system.
See https://developer.android.com/training/data-storage/use-cases#maintain_access_to_the_legacy_storage_location_for_data_migration for the relevant info.
try version https://github.com/ivpusic/react-native-image-crop-picker/releases/tag/v0.38.0
Version
Tell us which versions you are using:
- react-native-image-crop-picker v0.35.1
- react-native v0.62.2
Platform
Tell us to which platform this issue is related
Android
Expected behaviour
ImagePicker.openPicker() should return the selected image information.
Actual behaviour
Returns error code
E_NO_IMAGE_DATA_FOUND
and error messageInvalid image selected
on some devicesThis problem start to happen after we upgrading targetSdkVersion from 28 to 29. And it mostly happened on Android 10 devices, but not all Android 10 devices will have this problem. Here are some devices our customers have ever experienced this problem:
Xiaomi Mi 9T Xiaomi MI 8 Pro samsung SM-A505GN samsung SM-G986B samsung SM-A307GN samsung SM-G9650 samsung SM-G960F samsung SM-A7050 samsung SM-N9860 realme RMX1921 realme RMX2144 vivo vivo 1920 vivo vivo 1935 HTC HTC Desire 20 Pro OPPO CPH1941 HUAWEI LIO-L29 HUAWEI LYA-L29 asus ASUS_I01WD
After adding the android:requestLegacyExternalStorage="true" to AndroidManifest.xml, the problem is gone. Therefore, it seems 1ddd03e released in react-native-image-crop-picker 0.29.0 does not solve all issues related to new SDK 29 permission model completely?
This need to be fixed as the this workaround will no longer work if you target SDK 30.
Steps to reproduce
- set targetSdkVersion to 29 and don’t set requestLegacyExternalStorage in AndroidManifest.xml
- call ImagePicker.openPicker()
- some devices will return error E_NO_IMAGE_DATA_FOUND instead of the selected photo information
PR https://github.com/ivpusic/react-native-image-crop-picker/pull/1722 was merged