apache / cordova-plugin-camera

Apache Cordova Plugin camera

Home Page:https://cordova.apache.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does this plugin support cordova-android@9.x.x and above?

DONGNEZHA opened this issue · comments

Apache Cordova uses GitHub Issues as a feature request and bug tracker only.
For usage and support questions, please check out the resources below. Thanks!


You can get answers to your usage and support questions about Apache Cordova on:


If you are using a tool that uses Cordova internally, like e.g. Ionic, check their support channels:

I am using cordova-android@9.x.x but I am prompted with "Failed because: Class not found".

navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
    destinationType: Camera.DestinationType.FILE_URI });

function onSuccess(imageURI) {
    var image = document.getElementById('myImage');
    image.src = imageURI;
}

function onFail(message) {
    alert('Failed because: ' + message);
}

Modern versions of this plugin depends on AndroidX support libraries which cordova-android@9 has limited/buggy support for.

You'll need to use cordova-android@10 or later with the current release of cordova-plugin-camera. You can refer to the Release Notes to see when the platform requirements has changed.

Additionally, if you intend to deploy to Google Play store, then you'll need cordova-android@11 for API 31+ support.

However, I still have this problem with cordova-plugin-camera@5.0.3 as well.