BlinkID / blinkid-android

Everything you need to add AI-driven ID scanning into your native Android app.
https://microblink.com/identity/identity-document-scanning/
438 stars 153 forks source link

Error Migration from 5.20.0 to 6.0.0 - NoClassDefFoundError MicroblinkSDK #287

Closed abuenofacephi closed 1 year ago

abuenofacephi commented 1 year ago

Description

Migration from 5.20.0 to 6.0.0.

In the first place where we call to MicroblinkSDK.setLicenseKey(license, this), we are getting

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/microblink/blinkid/MicroblinkSDK;

Environment Details

BlinkID version: 6.0.0 Device model: Android multiple devices (Xiaomi redminote 8 pro) Device Android version: Android 10 Device ABI (processor architecture, e.g. ARMv7):

Log file

No more log than exposed in before steps

Additional information

aar good generated?

Thanks!

Brankacro commented 1 year ago

Hi @abuenofacephi and thanks for reaching out.

Just to double-check, have you renamed the packages from com.microblink to com.microblink.blinkid?

To do this you should replace all occurrences of com.microblink with com.microblink.blinkid.

As switching from v5 to v6 is a major API change, this is also mentioned in the transition guide here.

Please let us know if this helps. Also, feel free to reach out to us at support@microblink.com.

abuenofacephi commented 1 year ago

Hi, thanks for the support, we have detected the problem, we were excluding the library as we have two modules that used the same implement, and in one of them was the previous version. They were conflicting.

It compiled everything correctly, but at runtime it could not find the class. Searching through gradle we found the exclusion and we realized at the time of the error.

exclude(group: 'com.microblink', module: 'blinkid')

Thanks, best regards

Brankacro commented 1 year ago

Many thanks for your feedback and glad that the issue is resolved. If you will be having any additional questions, feel free to contact us at support@microblink.com. Best regards.