shijingsh / react-native-customized-image-picker

iOS/Android image picker with support for camera, video compression, multiple images and cropping
245 stars 59 forks source link

cropping: true causes Possible Unhandled Promise Rejection warning now? #52

Closed Mr-Ingram closed 6 years ago

Mr-Ingram commented 6 years ago

I did not change anything in my code and everything used to work along with the cropping feature. Image Picker Coder:

`SelectPhoto = () =>{ ImagePicker.openPicker({ cropping: true, title: 'Select a Quote', isCamera: true, includeBase64: true }).then((imgResponse) => { console.log(imgResponse); let imgSource = { uri: imgResponse[0].path }; let imgFileName = imgResponse[0].path.replace(/^.*[\\/]/, ''); this.setState({ userimgSource: imgSource, userimgSourceType: imgResponse[0].mime, userimgSourceSize: imgResponse[0].size, userimgSourceData: imgResponse[0].data, userimgFileName: imgFileName, }); });

}`

Now if I were to set cropping to false, it works. Does this have something to do with the Android Tools or updating something?

build.gradle:

` buildscript { repositories { maven { url 'https://maven.google.com' } jcenter()

}
dependencies {
    classpath 'com.android.tools.build:gradle:3.0.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects { repositories { mavenLocal() jcenter() maven { url 'https://maven.google.com' } maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url "$rootDir/../node_modules/react-native/android" } } } `

build.gradle app level:

`android { compileSdkVersion 26 buildToolsVersion "26.0.1"

configurations { all.exclude group: 'com.android.support', module: 'support-v4' all.exclude group: 'com.android.support', module: 'support-annotations' compile.exclude group: "org.apache.httpcomponents", module: "httpclient" }

defaultConfig {
    applicationId "com.example"
    minSdkVersion 16
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
  multiDexEnabled true

    ndk {
        abiFilters "armeabi-v7a", "x86"
    }`

If anyone needs more information please let me know! Any help on this is appreciated!