Open AuroPick opened 2 years ago
Where is the maintainers?
I can confirm that I got the same problem too with Xiaomi devices.
Facing the same issue is anyone working on this or resolved this issue??
No.
@AuroPick do you know how to open Gallery view instead of File Explorer on other devices?
No I don't know.
Bump
@AuroPick @ravi-roxiler @riorafe did you guys manage to fix this ?
Same problem here. I have a Redmi Note 10S. Anoyone found a solution?
Not yet. Pretty massive issue considering Xiaomi is #2 smartphone maker and has like 20% smartphone market share
Did anyone find the solution?
Baffling that there is no fix for this yet, I'll have to use react-native-image-picker instead
Baffling that there is no fix for this yet, I'll have to use react-native-image-picker instead
try this patch
react-native-image-crop-picker+0.37.3.patch
diff --git a/node_modules/react-native-image-crop-picker/android/src/main/AndroidManifest.xml b/node_modules/react-native-image-crop-picker/android/src/main/AndroidManifest.xml
index d9b32ba..c356fde 100644
--- a/node_modules/react-native-image-crop-picker/android/src/main/AndroidManifest.xml
+++ b/node_modules/react-native-image-crop-picker/android/src/main/AndroidManifest.xml
@@ -12,13 +12,13 @@
<application>
<provider
- android:name="androidx.core.content.FileProvider"
+ android:name=".IvpusicImagePickerFileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
- android:resource="@xml/provider_paths" />
+ android:resource="@xml/ivpusic_imagepicker_provider_paths" />
</provider>
<activity
diff --git a/node_modules/react-native-image-crop-picker/android/src/main/java/com/reactnative/ivpusic/imagepicker/IvpusicImagePickerFileProvider.java b/node_modules/react-native-image-crop-picker/android/src/main/java/com/reactnative/ivpusic/imagepicker/IvpusicImagePickerFileProvider.java
new file mode 100644
index 0000000..ca3bcf1
--- /dev/null
+++ b/node_modules/react-native-image-crop-picker/android/src/main/java/com/reactnative/ivpusic/imagepicker/IvpusicImagePickerFileProvider.java
@@ -0,0 +1,9 @@
+package com.reactnative.ivpusic.imagepicker;
+
+import androidx.core.content.FileProvider;
+
+/**
+ * A custom {@code FileProvider} prevents manifest {@code <provider>} name collisions.
+ */
+public class IvpusicImagePickerFileProvider extends FileProvider {
+}
\ No newline at end of file
diff --git a/node_modules/react-native-image-crop-picker/android/src/main/java/com/reactnative/ivpusic/imagepicker/PickerModule.java b/node_modules/react-native-image-crop-picker/android/src/main/java/com/reactnative/ivpusic/imagepicker/PickerModule.java
index 6335949..aa89952 100644
--- a/node_modules/react-native-image-crop-picker/android/src/main/java/com/reactnative/ivpusic/imagepicker/PickerModule.java
+++ b/node_modules/react-native-image-crop-picker/android/src/main/java/com/reactnative/ivpusic/imagepicker/PickerModule.java
@@ -378,8 +378,8 @@ class PickerModule extends ReactContextBaseJavaModule implements ActivityEventLi
galleryIntent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, multiple);
galleryIntent.addCategory(Intent.CATEGORY_OPENABLE);
- final Intent chooserIntent = Intent.createChooser(galleryIntent, "Pick an image");
- activity.startActivityForResult(chooserIntent, IMAGE_PICKER_REQUEST);
+ // final Intent chooserIntent = Intent.createChooser(galleryIntent, "Pick an image");
+ activity.startActivityForResult(galleryIntent, IMAGE_PICKER_REQUEST);
} catch (Exception e) {
resultCollector.notifyProblem(E_FAILED_TO_SHOW_PICKER, e);
}
diff --git a/node_modules/react-native-image-crop-picker/android/src/main/res/xml/provider_paths.xml b/node_modules/react-native-image-crop-picker/android/src/main/res/xml/ivpusic_imagepicker_provider_paths.xml
similarity index 100%
rename from node_modules/react-native-image-crop-picker/android/src/main/res/xml/provider_paths.xml
rename to node_modules/react-native-image-crop-picker/android/src/main/res/xml/ivpusic_imagepicker_provider_paths.xml
Baffling that there is no fix for this yet, I'll have to use react-native-image-picker instead
try this patch
react-native-image-crop-picker+0.37.3.patch
diff --git a/node_modules/react-native-image-crop-picker/android/src/main/AndroidManifest.xml b/node_modules/react-native-image-crop-picker/android/src/main/AndroidManifest.xml index d9b32ba..c356fde 100644 --- a/node_modules/react-native-image-crop-picker/android/src/main/AndroidManifest.xml +++ b/node_modules/react-native-image-crop-picker/android/src/main/AndroidManifest.xml @@ -12,13 +12,13 @@ <application> <provider - android:name="androidx.core.content.FileProvider" + android:name=".IvpusicImagePickerFileProvider" android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" - android:resource="@xml/provider_paths" /> + android:resource="@xml/ivpusic_imagepicker_provider_paths" /> </provider> <activity diff --git a/node_modules/react-native-image-crop-picker/android/src/main/java/com/reactnative/ivpusic/imagepicker/IvpusicImagePickerFileProvider.java b/node_modules/react-native-image-crop-picker/android/src/main/java/com/reactnative/ivpusic/imagepicker/IvpusicImagePickerFileProvider.java new file mode 100644 index 0000000..ca3bcf1 --- /dev/null +++ b/node_modules/react-native-image-crop-picker/android/src/main/java/com/reactnative/ivpusic/imagepicker/IvpusicImagePickerFileProvider.java @@ -0,0 +1,9 @@ +package com.reactnative.ivpusic.imagepicker; + +import androidx.core.content.FileProvider; + +/** + * A custom {@code FileProvider} prevents manifest {@code <provider>} name collisions. + */ +public class IvpusicImagePickerFileProvider extends FileProvider { +} \ No newline at end of file diff --git a/node_modules/react-native-image-crop-picker/android/src/main/java/com/reactnative/ivpusic/imagepicker/PickerModule.java b/node_modules/react-native-image-crop-picker/android/src/main/java/com/reactnative/ivpusic/imagepicker/PickerModule.java index 6335949..aa89952 100644 --- a/node_modules/react-native-image-crop-picker/android/src/main/java/com/reactnative/ivpusic/imagepicker/PickerModule.java +++ b/node_modules/react-native-image-crop-picker/android/src/main/java/com/reactnative/ivpusic/imagepicker/PickerModule.java @@ -378,8 +378,8 @@ class PickerModule extends ReactContextBaseJavaModule implements ActivityEventLi galleryIntent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, multiple); galleryIntent.addCategory(Intent.CATEGORY_OPENABLE); - final Intent chooserIntent = Intent.createChooser(galleryIntent, "Pick an image"); - activity.startActivityForResult(chooserIntent, IMAGE_PICKER_REQUEST); + // final Intent chooserIntent = Intent.createChooser(galleryIntent, "Pick an image"); + activity.startActivityForResult(galleryIntent, IMAGE_PICKER_REQUEST); } catch (Exception e) { resultCollector.notifyProblem(E_FAILED_TO_SHOW_PICKER, e); } diff --git a/node_modules/react-native-image-crop-picker/android/src/main/res/xml/provider_paths.xml b/node_modules/react-native-image-crop-picker/android/src/main/res/xml/ivpusic_imagepicker_provider_paths.xml similarity index 100% rename from node_modules/react-native-image-crop-picker/android/src/main/res/xml/provider_paths.xml rename to node_modules/react-native-image-crop-picker/android/src/main/res/xml/ivpusic_imagepicker_provider_paths.xml
Thanks SOOOOOO much. It's help me with Redmi
Version
Tell us which versions you are using:
Platform
Tell us to which platform this issue is related
Expected behaviour
It should open gallery
Actual behaviour
It opens file manager on xiaomi phones. It used to work but now it doesn't.
I have tried on Xiaomi Redmi Note 10 S and Xiaomi Mi 11 Lite.
Steps to reproduce
Click button
Call openPicker
Opens file manager
Attachments