Search code examples
typescriptionic-frameworkionic4

Ionic 4 Image Picker Crashing android app


I'm using ionic image picker to select multiple image and upload to firestore storage. But the plugin cordova image picker is crashing my android app. I saw a tutorial and done a poc. Plugin is wokring fine in poc . but when i implement it in my app it is crashing. Im stuck for more then one week. Please anyone help me with working solution.

alert('hello')
this.images = [];

var options = {
  maximumImagesCount: 3,
  outputType: 1
}
    this.imagePicker.getPictures(options).then(async (results) => {
    alert('Image URI: ');

    for (var i = 0; i < results.length; i++) {
      this.base64Image = 'data:image/jpg;base64,' + results[i];

    }
     (err) => {
    //   // Handle error
    }
  }).catch(err => {
    alert('hello'+err)
  })

Solution

  • You can use

    * `cordova plugin add cordova-android-support-gradle-release`
    * `ioinc cordova platform rm android`
    * `ionic cordova platform add android`
    * `ionic cordova build android`