iMicknl / cordova-plugin-openalpr

This Cordova plugin adds support for the OpenALPR (Automatic License Plate Recognition) library, which provides support for retrieving the license plate from a picture.
MIT License
33 stars 23 forks source link

Ionic 4 support? #36

Closed RZR666 closed 5 years ago

RZR666 commented 5 years ago

Anyone got this working on Ionic 4?

I'm taking the photo but the result of the scan is not returned.

iMicknl commented 5 years ago

This package is not actively maintained at the moment, so I am not 100% sure. However it doesn't look like something changed for Ionic Native modules. Are you using the Ionic Native module in combination with the @ionic-native/camera module?

I think your problem is not related to Ionic, but to the OpenALPR settings. Can you share more about your usecase / config?

rahul-ionic commented 5 years ago

Hi iMicknl,

I'm using this plugin in ionic v4. Plugin installed successfully but got error while making the build for android. Here are the errors:

BUILD FAILED in 2s 27 actionable tasks: 5 executed, 22 up-to-date /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/gradlew: Command failed with exit code 1 Error output: /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:10: error: package com.openalpr.jni does not exist import com.openalpr.jni.Alpr; ^ /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:11: error: package com.openalpr.jni does not exist import com.openalpr.jni.AlprException; ^ /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:12: error: package com.openalpr.jni does not exist import com.openalpr.jni.AlprPlate; ^ /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:13: error: package com.openalpr.jni does not exist import com.openalpr.jni.AlprPlateResult; ^ /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:14: error: package com.openalpr.jni does not exist import com.openalpr.jni.AlprResults; ^ /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:15: error: package com.openalpr.util does not exist import com.openalpr.util.Utils; ^ /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:149: error: cannot find symbol private Alpr initAlpr(JSONObject options, CallbackContext callbackContext) { ^ symbol: class Alpr location: class OpenALPR /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:184: error: cannot find symbol private JSONArray buildResponse(AlprResults results, JSONArray array) throws JSONException { ^ symbol: class AlprResults location: class OpenALPR /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:79: error: cannot find symbol Alpr alpr = initAlpr(options, callbackContext); ^ symbol: class Alpr location: class OpenALPR /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:80: error: cannot find symbol AlprResults results = null; ^ symbol: class AlprResults location: class OpenALPR /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:85: error: cannot find symbol } catch (AlprException e) { ^ symbol: class AlprException location: class OpenALPR /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:114: error: cannot find symbol Alpr alpr = initAlpr(options, callbackContext); ^ symbol: class Alpr location: class OpenALPR /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:115: error: cannot find symbol AlprResults results = null; ^ symbol: class AlprResults location: class OpenALPR /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:120: error: cannot find symbol } catch (AlprException e) { ^ symbol: class AlprException location: class OpenALPR /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:164: error: cannot find symbol Utils.copyAssetFolder(context.getAssets(), "runtime_data", ^ symbol: variable Utils location: class OpenALPR /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:170: error: cannot find symbol Alpr alpr = new Alpr(country, conf_file, runtime_dir); //Make new ALPR object with country EU and the config files from assets. ^ symbol: class Alpr location: class OpenALPR /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:170: error: cannot find symbol Alpr alpr = new Alpr(country, conf_file, runtime_dir); //Make new ALPR object with country EU and the config files from assets. ^ symbol: class Alpr location: class OpenALPR /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:185: error: cannot find symbol for (AlprPlateResult result : results.getPlates()) { ^ symbol: class AlprPlateResult location: class OpenALPR /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:186: error: cannot find symbol for (AlprPlate plate : result.getTopNPlates()) { ^ symbol: class AlprPlate location: class OpenALPR Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 19 errors

FAILURE: Build failed with an exception.

BUILD FAILED in 2s

Please suggest something to solve this issue.

thank you in advance.

rahul-ionic commented 5 years ago

Anyone got this working on Ionic 4?

I'm taking the photo but the result of the scan is not returned.

Did you successfully installed the plugin and made build successfully? Because After plugin installation in ionic v4 I'm not able to make the build.