I have tried this library react-native-image-crop-picker as suggested on this stackoverflow answer
I have followed each and every step mentioned here
- Run
npm i react-native-image-crop-picker@0.4.2
import ImagePicker from 'react-native-image-crop-picker';
then
ImagePicker.openPicker({width: 300,height: 400,cropping: true}).then(image => {console.log(image);});
Also in // file: android/settings.gradle
have added the below code
include ':react-native-image-crop-picker'project(':react-native-image-crop-picker').projectDir = newFile(settingsDir,'../node_modules/react-native-image-crop-picker/android')
Also as mentioned in the documentation have added required code in build.gradle
& MainActivity.java
file
But this is not working for me on Android
but working perfectly on iOS
. On Android
I have given to crop images by scale type only not as flexible crop.