bthurlow / nativescript-imagecropper

A nativescript image cropping plugin.
Other
49 stars 35 forks source link

When i try to use this with image picker the code run fine on android 9 but and in android 10 the source is empty. #70

Closed RohanPhpDev closed 4 years ago

RohanPhpDev commented 4 years ago

I have tried this code in android 9 and its work but in android 10 I log the source and it shows null.

const context = imagepickerModule.create({ mode: 'single' // allow choosing single image }); context .authorize() .then(function() { return context.present(); }) .then(function(selection) { selection.forEach(function(selected) { selected.getImageAsync(source => { if (source) { const selectedImgSource = imageSource.fromNativeSource(source); imageCropper .show(selectedImgSource, { width: 500, height: 500 }) .then(args => { if (args.image !== null) { // Use args.image } }) .catch(function(e) { console.log(e); }); } }); }); }) .catch(function(e) { console.log(e); }); © 2020 GitHub, Inc.

shiv19 commented 4 years ago

@RohanPhpDev please add this to your AndroidManifest.xml's application tag,

android:requestLegacyExternalStorage="true"

image

RohanPhpDev commented 4 years ago

Thanx shiv19 now its works.