Closed SonnyCampbell closed 5 years ago
Are you sure this is an error related to our plugin? I can't find any error which relate to a plugin file.
@SonnyCampbell,
Unfortunately our plugin does not work with Cordova Adnroid 7.0.0, you will have to downgrade to Cordova Android 6.3.0 with cordova platform add android@6.3.0
.
The way JNI files are being loaded into Android has been changed as of version 7.0.0, which renders our plugin useless since it depends on the OpenALPR JNI files.
We do not have any plans to fix this any time soon. So if you fix this yourself in the meantime feel free to create a new Pull Request.
Kind regards, Melvin
Edit: Forgot to mention, this was on version 1 ->
I was able to get this plugin working with android 7+ by using multiple plugins, the idea is to get the image, use a plugin to save it from base64 to file, here the app will request file permisisons, and you can then pass the file path to openalpr plugin.
To save the image from base64 I'm using: cordova plugin add https://github.com/tate-u/Canvas2ImagePlugin.git
and modify the Canvas2ImagePlugin.js with this:
module.exports = {
saveImageDataToLibrary: function (success, failure, canvas) {
var defaults = { canvas: null, fileName: "IMG_" + new Date().getTime(), album: 'Apps', success: function () { }, failure: function () { } };
var settings = Object.assign({}, defaults);
var imageData = canvas.replace(/data:image\/jpeg;base64,/, '');
return cordova.exec(success, failure, "Canvas2ImagePlugin", "saveImageDataToLibrary", [imageData, settings.fileName, settings.album]);
}
};
Then use it like this:
window.canvas2ImagePlugin.saveImageDataToLibrary(
function(msg){
cordova.plugins.OpenALPR.scan(msg) ...
},
function(error) {},
base64ImageData
);
Hope this helps.
Could you possibly give some indication of what's involved in making this plugin compatible with Android 7+?
Is it a case of altering the plugin.xml and placing files in different target folders etc. or is there far more to it than that?
Any advice is much appreciated.
I'm trying to integrate the cordova-plugin-openalpr with an ionic project. I have installed ionic and cordova from the installation instructions. I started a new project with
ionic start MyIonicProject tutorial
and then built the project usingionic cordova build android
.I added your plugin using
cordova plugin add cordova-plugin-openalpr
and when I try to build again it throws the below error. I also tried adding the plugin withionic cordova plugin add cordova-plugin-openalpr
and got the same result.This error seems to be an incompatibility with cordova-android 7.0.0, as a google of the error indicated that other people had this issue for different plugins because it was incompatible with cordova android 7.0.0.
`
Running
ionic info
gives: