Closed AlibekJ closed 5 years ago
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
Sorry, please use: Theme.AppCompat.NoActionBar
With this theme you will get the following:
Regards
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.
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
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
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
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
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
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?
Suggestion one above given by @i1E worked for me.
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?
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
);
};
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";
@jcular This solved it! Thanks so much for the help.
The following code crashes on Android
logcat:
Any ideas?