java.lang.NoClassDefFoundError: Failed resolution of: Lorg/tensorflow/lite/Interpreter$Options in 2.0.0072
Closed this issue · 3 comments
Affected versions: 2.0.0071 and 2.0.0072
Description
When CardScanActivity
is opened, it's closed automatically printing the following warning:
W: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/tensorflow/lite/Interpreter$Options;
W: at com.getbouncer.scan.payment.ml.SSDOcr$Factory.<init>(SSDOcr.kt:223)
W: at com.getbouncer.scan.payment.ml.SSDOcr$Factory.<init>(SSDOcr.kt:213)
W: at com.getbouncer.cardscan.ui.CardScanFlow$startFlow$1.invokeSuspend(CardScanFlow.kt:163)
W: at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
W: at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
W: at android.os.Handler.handleCallback(Handler.java:873)
W: at android.os.Handler.dispatchMessage(Handler.java:99)
W: at android.os.Looper.loop(Looper.java:201)
W: at android.app.ActivityThread.main(ActivityThread.java:6810)
W: at java.lang.reflect.Method.invoke(Native Method)
W: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
W: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
W: Caused by: java.lang.ClassNotFoundException: Didn't find class "org.tensorflow.lite.Interpreter$Options" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/it.prima.staging-Ur9RkKm3yUMsmeOTD978iw==/base.apk"],nativeLibraryDirectories=[/data/app/it.prima.staging-Ur9RkKm3yUMsmeOTD978iw==/lib/arm64, /data/app/it.prima.staging-Ur9RkKm3yUMsmeOTD978iw==/base.apk!/lib/arm64-v8a, /system/lib64]]
W: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:171)
W: at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
W: at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
W: ... 12 more
The version 2.0.0070 works correctly.
hi @fondesa , we changed how we import TensorFlow Lite in version 2.0.0071. Can you please add an explicit dependency to one of the following depending on your use case?
implementation 'com.getbouncer:tensorflow-lite:2.0.0072'
if you're not using TFLite anywhere else in your appimplementation 'com.getbouncer:tensorflow-lite-arm-only:2.0.0072'
if you're not using TFLite anywhere else in your app and you only support ARM architecturesimplementation 'com.tensorflow:tensorflow-lite:2.4.0'
if you are using TFLite elsewhere in your app
For more details, we updated our documentation for release 2.0.0071. Please see https://docs.getbouncer.com/bouncer-scan/credit-card-ocr/android-integration-guide#installation
Sorry, I had read only the changelog and not the documentation before updating it. Adding the TensortFlow Lite dependency fixes the problem, thanks.
This should have been more clear in the changelog. I'll make sure to note larger changes like this there going forward. Thanks for pointing that out!