Git Product home page Git Product logo

Comments (14)

culoi avatar culoi commented on June 14, 2024

Hello @AlibekJ ,

java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.

Please edit AndroidManifest.xml and set theme to Theme.AppCompat

Which version of the Cordova are you using?

Regards

from blinkid-cordova.

culoi avatar culoi commented on June 14, 2024

Sorry, please use: Theme.AppCompat.NoActionBar

With this theme you will get the following:

theme_appcompat_noactionbar

Regards

from blinkid-cordova.

AlibekJ avatar AlibekJ commented on June 14, 2024

I am on cordova 8.1..0

Please edit AndroidManifest.xml and set theme to Theme.AppCompat

Sorry, culoi, would you, please, be more specific. I found 14 AndroidManifest.xml files, modified the one in /platforms/android/CordovaLib like this:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="org.apache.cordova" android:versionName="1.0" android:versionCode="1" android:theme="@android:style/Theme.AppCompat.NoActionBar">
    <uses-sdk android:minSdkVersion="16" />
</manifest>

and it had no effect. I am not sure what I am doing.

from blinkid-cordova.

willuhn avatar willuhn commented on June 14, 2024

I had exactly the same problem. Took me about a week to find out: It's the "DocumentVerificationOverlaySettings". Use "DocumentOverlaySettings" instead.

I've no idea, what the difference is, but it doesn't crash anymore. The demo code also uses "DocumentOverlaySettings": https://github.com/BlinkID/blinkid-phonegap/blob/master/www/js/index.js#L78

from blinkid-cordova.

culoi avatar culoi commented on June 14, 2024

If you are using CombinedRecognizer, documentVerificationOverlay is must, as it notifiy the user to scan the front and the back side.

Please check it our more here: https://github.com/BlinkID/blinkid-android#-documentverificationactivity-and-documentverificationoverlaycontroller

You can also check out our video of implementing verificationOverlay and UsdlCombined recognizer: https://github.com/BlinkID/blinkid-phonegap#using-documentverificationoverlay-and-combinedrecognizer

Regards

from blinkid-cordova.

culoi avatar culoi commented on June 14, 2024

Hello @AlibekJ

Location of the AndroidManifex.xml is as following:

/platforms/android/app/src/main/

Please test it out and let us know how it works.

Regards

from blinkid-cordova.

AlibekJ avatar AlibekJ commented on June 14, 2024

Tried your suggestion, modified /platforms/android/app/src/main/AndroidManifest.xml

However, when trying to build, script adds another line into AndroidManifest.xml like this:

<activity android:configChanges="orientation|screenSize" android:name="com.microblink.activity.ScanCard" android:screenOrientation="portrait" android:theme="@android:style/Theme.AppCompat.NoActionBar" />
<activity android:configChanges="orientation|screenSize" android:name="com.microblink.activity.ScanCard" android:screenOrientation="portrait" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />

so naturally it fails with:

Element activity#com.microblink.activity.ScanCard at AndroidManifest.xml:13:9-212 duplicated with element declared at AndroidManifest.xml:12:9-212

from blinkid-cordova.

i1E avatar i1E commented on June 14, 2024

Hi @AlibekJ,

you have to modify the AndroidManifest.xml inside the demo application that is created with initCordovaDemoApp.sh script (after this scrip is executed), or AndroidManifest.xml inside your application if you don't use initCordovaDemoApp.sh.

In the next release of the BlinkID cordova plugin, this will be fixed and you won't need to do any modifications to make things work.

Best Regards

from blinkid-cordova.

cameronwiebe avatar cameronwiebe commented on June 14, 2024

I am having this same issue on iOS. When using the same code as @AlibekJ above, I receive the following error:

-[NSNull length]: unrecognized selector sent to instance 0x1b4c7f878

Reverting to var documentOverlaySettings = new cordova.plugins.BlinkID.DocumentOverlaySettings(); fixes the error but does not allow me to scan both the front and back of the ID. Thoughts?

from blinkid-cordova.

AlibekJ avatar AlibekJ commented on June 14, 2024

Suggestion one above given by @i1E worked for me.

from blinkid-cordova.

cameronwiebe avatar cameronwiebe commented on June 14, 2024

Suggestion one above given by @i1E worked for me.

Thanks for the response! I am only interested in getting this working on iOS at the moment. It seems the solution above is addressing android builds. Is there something similar I need to do to get this going on iOS?

from blinkid-cordova.

AlibekJ avatar AlibekJ commented on June 14, 2024

Try this. I just ran it on iOS and it worked.

  let usdlCombinedRecognizer = new cordova.plugins.BlinkID.UsdlCombinedRecognizer();
  usdlCombinedRecognizer.returnFaceImage = true;
  usdlCombinedRecognizer.returnFullDocumentImage = true;
  let documentOverlaySettings = new cordova.plugins.BlinkID.DocumentVerificationOverlaySettings();
  let usdlSuccessFrameGrabber = new cordova.plugins.BlinkID.SuccessFrameGrabberRecognizer(usdlCombinedRecognizer);
  let recognizerCollection = new cordova.plugins.BlinkID.RecognizerCollection([usdlSuccessFrameGrabber]);

  myfunction = function () {
    cordova.plugins.BlinkID.scanWithCamera(
      function callback(cancelled) {
        if (usdlCombinedRecognizer.result.resultState == cordova.plugins.BlinkID.RecognizerResultState.valid) {

        }
      },
      function errorHandler(err) {},
      documentOverlaySettings, recognizerCollection, licenseKeys
    );
  };

from blinkid-cordova.

jcular avatar jcular commented on June 14, 2024

Hi @cameronwiebe,

can you try setting the property values on DocumentVerificationOverlaySettings to following values and not to null?

glareMessage = "Slightly move ID to eliminate glare.";
firstSideInstructions = "Place the front side of the document in the frame and wait for automatic scan.";
secondSideInstructions = "Place the back side of the document in the frame and wait for automatic scan.";
firstSideSplashMessage = "Document front side";
secondSideSplashMessage = "Document back side";
scanningDoneSplashMessage = "Document scanning done";

from blinkid-cordova.

cameronwiebe avatar cameronwiebe commented on June 14, 2024

@jcular This solved it! Thanks so much for the help.

from blinkid-cordova.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.