Coder Social home page Coder Social logo

Comments (5)

filipef101 avatar filipef101 commented on May 17, 2024 6

This is because pictureselector re-implemented(copy pasted afaik) ucrop internally so it conflicts
I solved it by just applyint this patch (using patch-package)

diff --git a/node_modules/react-native-image-crop-picker/android/build.gradle b/node_modules/react-native-image-crop-picker/android/build.gradle
index 48443cc..3d9714f 100644
--- a/node_modules/react-native-image-crop-picker/android/build.gradle
+++ b/node_modules/react-native-image-crop-picker/android/build.gradle
@@ -22,5 +22,5 @@ android {
 dependencies {
     implementation 'com.facebook.react:react-native:+'
     implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
-    implementation 'com.github.yalantis:ucrop:2.2.6-native'
+    implementation 'io.github.lucksiege:pictureselector:v2.7.3-rc08'
 }
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 c6b09a9..1ff1225 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
@@ -19,6 +19,7 @@ import android.webkit.MimeTypeMap;
 
 import androidx.core.app.ActivityCompat;
 import androidx.core.content.FileProvider;
+import androidx.appcompat.app.AppCompatActivity;
 
 import com.facebook.react.bridge.ActivityEventListener;
 import com.facebook.react.bridge.Callback;
@@ -680,7 +681,7 @@ class PickerModule extends ReactContextBaseJavaModule implements ActivityEventLi
             uCrop.withAspectRatio(width, height);
         }
 
-        uCrop.start(activity);
+        uCrop.start(activity, UCrop.REQUEST_CROP);
     }
 
     private void imagePickerResult(Activity activity, final int requestCode, final int resultCode, final Intent data) {

from react-native-multiple-image-picker.

filipef101 avatar filipef101 commented on May 17, 2024 3

Basically making react native crop picker use pictureselector uCrop instead of ucrop directly. since then both package reference picture selector methods it doesn't conflict anymore 🎉 changeing uCrop.start some other places might be needed, for my use case only here was needed

from react-native-multiple-image-picker.

baronha avatar baronha commented on May 17, 2024

I tried to solve this but failed. So I added crop image to android in 0.4.8. Documentation is here. And I'm planning to implement crop image in iOS in the next version.

from react-native-multiple-image-picker.

filipef101 avatar filipef101 commented on May 17, 2024

Think this could be solved on app level gradle somehow, any ideas btw? Thinking something like this https://docs.gradle.org/current/userguide/resolution_rules.html#sec:module_replacement

from react-native-multiple-image-picker.

baronha avatar baronha commented on May 17, 2024

Try upgrade to v.1.0.2

from react-native-multiple-image-picker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.