Unfortunately app closed in Android Image Picker plugin

#1

When i call this code

try { this.imagePicker.getPictures({maximumImagesCount: 5}).then((results) => { for (let i = 0; i < results.length; i++) { try { let result = results[i]; } catch (e) { break; } } }, (err) => { }); } catch(e){ }

then app will be unfortunately closed

I also tired remove plugin and add plugin link: https://ionicframework.com/docs/native/image-picker/
Is there any solutions?
Thanks in advance
-Anand

#2

I think it’s because of permission in android? I’m just not too sure about it… maybe others can help too…

#3

I’m using Android 5.1, actual code is…

pickImages(){
    if(!ImagePicker.installed()){
      this.glopal.showAlertDialog('Error1','Plugin not Found!');
      return;
    } else this.glopal.showAlertDialog('ImagePicker','Plugin Found!');
    if(!this.imagePicker.hasReadPermission()){
      this.imagePicker.requestReadPermission();
      return;
    }
    this.imagePicker.getPictures({maximumImagesCount: 5}).then((results) => {
      for (let i = 0; i < results.length; i++) {
        try {
          let result = results[i];
          this.pushFileToList(result,5)
        } catch (e){
          this.glopal.showAlertDialog('File Attach Failed',e.toString());
          break;
        }
      }
    }, (err) => {
      this.glopal.showAlertDialog('Error',err.toString())
    });
  }
#4

I am also facing same issue. how to resolve it?

#5

Yes it may be because of the permission. Try adding the permission to access the files.

#6

I am also facing this problem, any other solution?

#7

have you any solution?
-sam

#8

do you add google maps plugin ?
if you add it try to remove google maps plugin and try again
i think there is some conflict with google maps plugin