Avish Bansal
Avish Bansal

Reputation: 21

ERROR Error: Uncaught (in promise): Asset '/storage/emulated/0/DCIM/Restored/IMG_20200115_103131.jpg' cannot be found

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);

Upvotes: 1

Views: 788

Answers (1)

HoLeX
HoLeX

Reputation: 26

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

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

Upvotes: 1

Related Questions