I am trying to take photos on Android with my Cordova app. It is a very simple implementation using the below snippet:
navigator.camera.getPicture((src) => {
image.src = `url('data:image/jpeg;base64,${src}')`;
}, (err) => {
throw err;
}, {
quality: 50,
destinationType: Camera.DestinationType.DATA_URL,
sourceType: Camera.PictureSourceType.camera,
encodingType: Camera.EncodingType.JPEG,
mediaType: Camera.MediaType.PICTURE,
allowEdit: false,
correctOrientation: true,
targetWidth: 1024,
targetheight: 1024
});
With image being an object I save in localStorage for use later.
It worked perfectly until recently and I can't figure out what I did to break it. I did not change any config XML files or update any node packages, and the code was not changed. The error I get on debugging is this:
Uncaught Attempt to invoke virtual method 'android.content.res.XmlResourceParser android.content.pm.ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference
In addition, the application crashes when allowing file access permissions.