Cordova plugin capture-plugin-media not working with android version 8 and 8.1 above

After browsing it seems like it is problem with permission related problem. However I could not get proper solution working around with this plugin. Although it is working fine for android version below 7.

let options: CaptureImageOptions = { limit: 3 };
this.mediaCapture.captureImage(options)
.then(
(data: MediaFile) => console.log(data),
(err: CaptureError) => console.error(err)
);
}

In many cases it is written fixed. However in my case it is not working. The plugin suddenly crashes the app.

Ionic:

ionic (Ionic CLI) : 4.0.1 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.0

Cordova:

cordova (Cordova CLI) : 8.0.0
Cordova Platforms : android 6.4.0, ios 4.5.5

System:

Android SDK Tools : 24.3.4
ios-deploy : 1.9.4
ios-sim : 5.0.8
NodeJS : v10.14.2 (/usr/local/bin/node)
npm : 6.4.1
OS : macOS
Xcode : Xcode 9.3.1 Build version 9E501

1 Like