Working on nativescript application and need to access image and convert it into base64.

.then(function(selection) {
    selection.forEach(function (selected) {
        imageSourceModule
        .fromAsset(selected)
        .then((imageSource) => {
            var imageBase64 = imageSource.toBase64String("jpg",60);
            console.log(imageBase64);
1

There are 1 best solutions below

0
On BEST ANSWER

I've got the same problem with fromAsset and I solved it by doing this.

<application
  ...
    android:requestLegacyExternalStorage="true"
  ...
</application>