Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrated blinkid with JPush app crash #163

Closed
qianduan-duanwei opened this issue Jun 25, 2019 · 6 comments
Closed

Integrated blinkid with JPush app crash #163

qianduan-duanwei opened this issue Jun 25, 2019 · 6 comments

Comments

@qianduan-duanwei
Copy link

Description

When init BlinkID use MicroblinkSDK.setLicenseKey api then app crash, Because we used Jpush (a third-party message push component)

Environment Details

BlinkID version:
4.5.0

Device model:
RedMi 5A

Device Android version:
8.1.0

Log file

java.lang.RuntimeException: Unable to create application my.primekeeper.android.uat.MyApplication: com.microblink.recognition.InvalidLicenceKeyException: Invalid license buffer magic number. License buffer is corrupted!
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5829)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1685)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:6651)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)
Caused by: com.microblink.recognition.InvalidLicenceKeyException: Invalid license buffer magic number. License buffer is corrupted!
at com.microblink.MicroblinkSDK.setLicenseFile(line:167)
at my.primekeeper.android.uat.MyApplication.onCreate(MyApplication.java:24)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1120)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5826)

@culoi
Copy link
Contributor

culoi commented Jun 25, 2019

Hello,

Please make sure that you are setting a correct license key. This line in the log indicates that you are either using wrong key or you are not setting it correctly:

Caused by: com.microblink.recognition.InvalidLicenceKeyException: Invalid license buffer magic number. License buffer is corrupted!
at com.microblink.MicroblinkSDK.setLicenseFile(line:167)

Please contact us at support@microblink.com with your license key and package name.

Regards

@qianduan-duanwei
Copy link
Author

Hello,

Please make sure that you are setting a correct license key. This line in the log indicates that you are either using wrong key or you are not setting it correctly:

Caused by: com.microblink.recognition.InvalidLicenceKeyException: Invalid license buffer magic number. License buffer is corrupted!
at com.microblink.MicroblinkSDK.setLicenseFile(line:167)

Please contact us at support@microblink.com with your license key and package name.

Regards
Hi,
I used the correct key, But still crashed.

Log file
java.lang.RuntimeException: Unable to create application my.primekeeper.android.uat.MyApplication: com.microblink.recognition.InvalidLicenceKeyException: This license is invalid for licensee 'my.primekeeper.android.uat:pushcore'. It is valid only for licensee 'my.primekeeper.android.uat', for product 'BlinkID' on platform 'Android' up to version 4.10. Please contact support for more information.
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5829)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1685)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:6651)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)
Caused by: com.microblink.recognition.InvalidLicenceKeyException: This license is invalid for licensee 'my.primekeeper.android.uat:pushcore'. It is valid only for licensee 'my.primekeeper.android.uat', for product 'BlinkID' on platform 'Android' up to version 4.10. Please contact support for more information.
at com.microblink.MicroblinkSDK.setLicenseKey(line:108)
at my.primekeeper.android.uat.MyApplication.onCreate(MyApplication.java:24)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1120)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5826)

The initialization code in my program is as follows
@OverRide
public void onCreate() {
super.onCreate();
this.app = this;
JPushInterface.setDebugMode(true);
JPushInterface.init(this);
MicroblinkSDK.setShowTimeLimitedLicenseWarning(false);
MicroblinkSDK.setLicenseKey(key, this);
MicroblinkSDK.setIntentDataTransferMode(IntentDataTransferMode.PERSISTED_OPTIMISED);
}

@culoi
Copy link
Contributor

culoi commented Jun 26, 2019

Hello @qianduan-duanwei

You have a correct license key for your application, but from the log, it looks like the jpush modifies your application identifier:

java.lang.RuntimeException: Unable to create application my.primekeeper.android.uat.MyApplication: com.microblink.recognition.InvalidLicenceKeyException: This license is invalid for licensee 'my.primekeeper.android.uat:pushcore'. It is valid only for licensee 'my.primekeeper.android.uat', for product 'BlinkID' on platform 'Android' up to version 4.10. Please contact support for more information.

Your license key is generated for the my.primekeeper.android.uat

It is valid only for licensee 'my.primekeeper.android.uat'

@qianduan-duanwei
Copy link
Author

Hello @qianduan-duanwei

You have a correct license key for your application, but from the log, it looks like the jpush modifies your application identifier:

java.lang.RuntimeException: Unable to create application my.primekeeper.android.uat.MyApplication: com.microblink.recognition.InvalidLicenceKeyException: This license is invalid for licensee 'my.primekeeper.android.uat:pushcore'. It is valid only for licensee 'my.primekeeper.android.uat', for product 'BlinkID' on platform 'Android' up to version 4.10. Please contact support for more information.

Your license key is generated for the my.primekeeper.android.uat

It is valid only for licensee 'my.primekeeper.android.uat'

Is there any way for one license key can been valid to two licensee 'my.primekeeper.android.uat' and 'my.primekeeper.android.uat:pushcore'

@culoi
Copy link
Contributor

culoi commented Jun 26, 2019

Hello @qianduan-duanwei ,

There is, the method can be used to unlock the SDK in library mode, i.e. when Microblink SDK is being packaged inside 3rd party SDK but this type of key requires special "multiple apps" permission. This can be discussed with our Sales team or your account manager with whom you sign the contract.
Hope this helps.

Regards

@culoi
Copy link
Contributor

culoi commented Jul 19, 2019

We have improved the license key's validation by application id in version 4.10.0 of our BlinkID SDK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants