googlesamples / mlkit

A collection of sample apps to demonstrate how to use Google's ML Kit APIs on Android and iOS
Apache License 2.0
3.58k stars 2.93k forks source link

couldn't find "libbarhopper_v2.so" #483

Open lazh opened 2 years ago

lazh commented 2 years ago

CrashHandler[133]: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.szsbay.smarthome.alpha-nawDjNvWFlw9cZ2vLVywAQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.szsbay.smarthome.alpha-nawDjNvWFlw9cZ2vLVywAQ==/lib/arm, /data/app/com.szsbay.smarthome.alpha-nawDjNvWFlw9cZ2vLVywAQ==/base.apk!/lib/armeabi, /system/lib, /system/vendor/lib]]] couldn't find "libbarhopper_v2.so":Exception:java.lang.UnsatisfiedLinkError at java.lang.Runtime.loadLibrary0(Runtime.java:1011) at java.lang.System.loadLibrary(System.java:1657) at com.google.android.libraries.barhopper.BarhopperV2.(com.google.mlkit:barcode-scanning@@16.2.0:1) at com.google.mlkit.vision.barcode.bundled.internal.zza.zzc(com.google.mlkit:barcode-scanning@@16.2.0:1) at com.google.android.gms.internal.mlkit_vision_barcode_bundled.zzaa.zza(com.google.mlkit:barcode-scanning@@16.2.0:8) at com.google.android.gms.internal.mlkit_vision_barcode_bundled.zzb.onTransact(com.google.mlkit:barcode-scanning@@16.2.0:3) at android.os.Binder.transact(Binder.java:607) at com.google.android.gms.internal.mlkit_vision_barcode.zza.zzc(com.google.android.gms:play-services-mlkit-barcode-scanning@@16.2.0:2) at com.google.android.gms.internal.mlkit_vision_barcode.zzmz.zze(com.google.android.gms:play-services-mlkit-barcode-scanning@@16.2.0:2) at com.google.mlkit.vision.barcode.internal.zzm.zza(com.google.android.gms:play-services-mlkit-barcode-scanning@@16.2.0:3) at com.google.mlkit.vision.barcode.internal.zzi.zzc(com.google.android.gms:play-services-mlkit-barcode-scanning@@16.2.0:3) at com.google.mlkit.vision.barcode.internal.zzi.run(com.google.android.gms:play-services-mlkit-barcode-scanning@@16.2.0:1) at com.google.mlkit.vision.common.internal.MobileVisionBase.zza(com.google.mlkit:vision-common@@16.5.0:2) at com.google.mlkit.vision.common.internal.zzd.call(null:4) at com.google.mlkit.common.sdkinternal.ModelResource.zza(com.google.mlkit:common@@17.2.0:8) at com.google.mlkit.common.sdkinternal.zzm.run(null:10) at com.google.mlkit.common.sdkinternal.zzp.run(com.google.mlkit:common@@17.2.0:2) at com.google.mlkit.common.sdkinternal.MlKitThreadPool.zze(com.google.mlkit:common@@17.2.0:4) at com.google.mlkit.common.sdkinternal.MlKitThreadPool.zzc(com.google.mlkit:common@@17.2.0:1) at com.google.mlkit.common.sdkinternal.zzi.run(null:2) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at com.google.mlkit.common.sdkinternal.MlKitThreadPool.zzd(com.google.mlkit:common@@17.2.0:2) at com.google.mlkit.common.sdkinternal.zzj.run(null:2) at java.lang.Thread.run(Thread.java:764)

Xiaomi System - Android 8.1 https://stackoverflow.com/questions/63901069/google-ml-kit-couldnt-find-libbarhopper-v2-so

zhouyiself commented 2 years ago

libbarhopper_v2.so is from an old version 16.2.0, can you try the latest SDK version 17.0.2 instead? https://developers.google.com/ml-kit/vision/barcode-scanning/android#before-you-begin

noufilCrofarm commented 2 years ago

I am still facing this issue on 17.0.2 version.

Fatal Exception: java.lang.UnsatisfiedLinkError dlopen failed: library "libbarhopper_v3.so" not found java.lang.Runtime.loadLibrary0 (Runtime.java:1087) java.lang.Runtime.loadLibrary0 (Runtime.java:1008) java.lang.System.loadLibrary (System.java:1664) com.google.android.libraries.barhopper.BarhopperV3. (BarhopperV3.java:5) com.google.mlkit.vision.barcode.bundled.internal.zza.zzc (zza.java:32) com.google.android.gms.internal.mlkit_vision_barcode_bundled.zzbk.zza (zzbk.java:32) com.google.android.gms.internal.mlkit_vision_barcode_bundled.zzb.onTransact (zzb.java:20) android.os.Binder.transact (Binder.java:1043) com.google.android.gms.internal.mlkit_vision_barcode.zza.zzc (zza.java:7) com.google.android.gms.internal.mlkit_vision_barcode.zzox.zze (zzox.java:3) com.google.mlkit.vision.barcode.internal.zzl.zza (zzl.java:3) com.google.mlkit.vision.barcode.internal.zzi.zzc (zzi.java:1) com.google.mlkit.vision.common.internal.MobileVisionBase.zza (MobileVisionBase.java:12) com.google.mlkit.vision.common.internal.zzd.call (zzd.java:12) com.google.android.gms.measurement.internal.zzfu.call$bridge (zzfu.java:12) com.google.mlkit.common.sdkinternal.ModelResource.zza (ModelResource.java:5) com.google.mlkit.common.sdkinternal.zzl.run (zzl.java:5) com.google.mlkit.common.sdkinternal.zzp.run (zzp.java:118) com.google.android.gms.common.api.internal.zacb.run$bridge (zacb.java:118) com.google.mlkit.common.sdkinternal.MlKitThreadPool.zze (MlKitThreadPool.java:2) com.google.mlkit.common.sdkinternal.MlKitThreadPool.zzc (MlKitThreadPool.java:11) com.google.mlkit.common.sdkinternal.zzi.run (zzi.java:11) com.google.android.gms.measurement.internal.zzhq.run$bridge (zzhq.java:11) java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167) java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641) com.google.mlkit.common.sdkinternal.MlKitThreadPool.zzd (MlKitThreadPool.java:2) com.google.mlkit.common.sdkinternal.zzj.run (zzj.java:2) com.google.android.gms.common.api.internal.zacf.run$bridge (zacf.java:2) java.lang.Thread.run (Thread.java:923)

usewr commented 2 years ago

facing the same crash, any way to prevent the lib from crashing , consumers are having bad experience.

SilverDestiny commented 2 years ago

Hi, this error means the native library wasn't loaded correctly.

Could you check the native library was there in your built APK, for the correct architecture, normally arm64? Did you configure anything like https://developers.google.com/ml-kit/tips/reduce-app-size#advanced_exclude_unused_ml_kit_binaries in your app?

drunamana commented 2 years ago

I also encounter this crash on version 17.0.2 and below

Fatal Exception: java.lang.UnsatisfiedLinkError: dlopen failed: library "libbarhopper_v3.so" not found at java.lang.Runtime.loadLibrary0(Runtime.java:1077) at java.lang.Runtime.loadLibrary0(Runtime.java:998) at java.lang.System.loadLibrary(System.java:1661) at com.google.android.libraries.barhopper.BarhopperV3.(com.google.mlkit:barcode-scanning@@17.0.2:1) at com.google.mlkit.vision.barcode.bundled.internal.zza.zzc(com.google.mlkit:barcode-scanning@@17.0.2:1) at com.google.android.gms.internal.mlkit_vision_barcode_bundled.zzbk.zza(com.google.mlkit:barcode-scanning@@17.0.2:8) at com.google.android.gms.internal.mlkit_vision_barcode_bundled.zzb.onTransact(com.google.mlkit:barcode-scanning@@17.0.2:3) at android.os.Binder.transact(Binder.java:1100) at com.google.android.gms.internal.mlkit_vision_barcode.zza.zzc(com.google.android.gms:play-services-mlkit-barcode-scanning@@18.0.0:2) at com.google.android.gms.internal.mlkit_vision_barcode.zzox.zze(com.google.android.gms:play-services-mlkit-barcode-scanning@@18.0.0:2) at com.google.mlkit.vision.barcode.internal.zzl.zza(com.google.android.gms:play-services-mlkit-barcode-scanning@@18.0.0:3) at com.google.mlkit.vision.barcode.internal.zzi.zzc(com.google.android.gms:play-services-mlkit-barcode-scanning@@18.0.0:3) at com.google.mlkit.vision.barcode.internal.zzi.run(com.google.android.gms:play-services-mlkit-barcode-scanning@@18.0.0:1) at com.google.mlkit.vision.common.internal.MobileVisionBase.zza(MobileVisionBase.java:2) at com.google.mlkit.vision.common.internal.zzd.call(com.google.mlkit:vision-common@@17.1.0:2) at com.google.mlkit.common.sdkinternal.ModelResource.zza(ModelResource.java:8) at com.google.mlkit.common.sdkinternal.zzl.run(com.google.mlkit:common@@18.1.0:8) at com.google.mlkit.common.sdkinternal.zzp.run(com.google.mlkit:common@@18.1.0:2) at com.google.mlkit.common.sdkinternal.MlKitThreadPool.zze(com.google.mlkit:common@@18.1.0:4) at com.google.mlkit.common.sdkinternal.MlKitThreadPool.zzc(MlKitThreadPool.java:1) at com.google.mlkit.common.sdkinternal.zzi.run(com.google.mlkit:common@@18.1.0:1) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at com.google.mlkit.common.sdkinternal.MlKitThreadPool.zzd(MlKitThreadPool.java:2) at com.google.mlkit.common.sdkinternal.zzj.run(com.google.mlkit:common@@18.1.0:2) at java.lang.Thread.run(Thread.java:1012)

SilverDestiny commented 2 years ago

Could you check the native library was there in your built APK, for the correct architecture, normally arm64? Did you configure anything like https://developers.google.com/ml-kit/tips/reduce-app-size#advanced_exclude_unused_ml_kit_binaries in your app?

drunamana commented 2 years ago

As far as I remember, there was no problem with the universal apk. The problem appeared when using the app bundle.

The configuration of abiFilters is present:

ndk { abiFilters "arm64-v8a", "armeabi-v7a", "x86", "x86_64" }

When building the app bundle under arm64-v8a, the library is present in the set by architecture. (1- App bundle content, 2- base-arm64_v8a.apk content)

1 2

alexbusuioc commented 1 year ago

same issue on 17.0.3. has anyone found a solution to this?

drunamana commented 1 year ago

Searching. Noticed this bug on universal apk as well, so the bug is reproduced by app bundle/universal apk

or-else commented 1 year ago

Fatal Exception: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/co.tinode.tindroidx-g0RQaGr2XCRWbVBaDGsvNQ==/base.apk"],nativeLibraryDirectories=[/data/app/co.tinode.tindroidx-g0RQaGr2XCRWbVBaDGsvNQ==/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libbarhopper_v3.so" at java.lang.Runtime.loadLibrary0(Runtime.java:1011) at java.lang.System.loadLibrary(System.java:1657) at com.google.android.libraries.barhopper.BarhopperV3.(com.google.mlkit:barcode-scanning@@17.0.3:1) at com.google.mlkit.vision.barcode.bundled.internal.zzb.zzc(com.google.mlkit:barcode-scanning@@17.0.3:1) at com.google.android.gms.internal.mlkit_vision_barcode_bundled.zzbk.zza(com.google.mlkit:barcode-scanning@@17.0.3:9) at com.google.android.gms.internal.mlkit_vision_barcode_bundled.zzb.onTransact(com.google.mlkit:barcode-scanning@@17.0.3:3) at android.os.Binder.transact(Binder.java:627) at com.google.android.gms.internal.mlkit_vision_barcode.zza.zzc(com.google.android.gms:play-services-mlkit-barcode-scanning@@18.1.0:2) at com.google.android.gms.internal.mlkit_vision_barcode.zzqb.zze(com.google.android.gms:play-services-mlkit-barcode-scanning@@18.1.0:2) at com.google.mlkit.vision.barcode.internal.zzl.zza(com.google.android.gms:play-services-mlkit-barcode-scanning@@18.1.0:3) at com.google.mlkit.vision.barcode.internal.zzi.zze(com.google.android.gms:play-services-mlkit-barcode-scanning@@18.1.0:3) at com.google.mlkit.vision.barcode.internal.zzi.run(com.google.android.gms:play-services-mlkit-barcode-scanning@@18.1.0:1) at com.google.mlkit.vision.common.internal.MobileVisionBase.zza(com.google.mlkit:vision-common@@17.3.0:2) at com.google.mlkit.vision.common.internal.zza.call(com.google.mlkit:vision-common@@17.3.0:5) at com.google.mlkit.common.sdkinternal.ModelResource.zza(com.google.mlkit:common@@18.6.0:8) at com.google.mlkit.common.sdkinternal.zzn.run(com.google.mlkit:common@@18.6.0:11) at com.google.mlkit.common.sdkinternal.zzt.run(com.google.mlkit:common@@18.6.0:2) at com.google.mlkit.common.sdkinternal.MlKitThreadPool.zze(com.google.mlkit:common@@18.6.0:4) at com.google.mlkit.common.sdkinternal.MlKitThreadPool.zzc(com.google.mlkit:common@@18.6.0:1) at com.google.mlkit.common.sdkinternal.zzk.run(com.google.mlkit:common@@18.6.0:3) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at com.google.mlkit.common.sdkinternal.MlKitThreadPool.zzd(com.google.mlkit:common@@18.6.0:2) at com.google.mlkit.common.sdkinternal.zzi.run(com.google.mlkit:common@@18.6.0:3) at java.lang.Thread.run(Thread.java:764)

vpmalley commented 1 year ago

Got the same exception in versions 17.0.2, 17.0.3, 17.1.0. I noticed that only devices with Android 13 are impacted. Not all users are, though. Another thing is the app uses some dynamic features (but the barcode MLKit is in the main app module), I wondered if this could have an impact on the packaging part. I downloaded the APKs for one of the impacted devices and I couldn't see a difference between the APKs downloaded for this version and a previous one without dynamic features, so that's unlikely.

vpmalley commented 1 year ago

Another thing is the app uses some dynamic features (but the barcode MLKit is in the main app module), I wondered if this could have an impact on the packaging part.

I realised this was the cause of the issue. If the base app (which contains the barcode library) is installed and no other module is installed, it works fine. If a module is installed and the activity is restarted, it works fine. If a new module has just been installed in the current activity but the native libraries aren't reloaded and the activity isn't restarted, it causes this kind of crash. Hopefully that can give a hint to some of you.

YMonnier commented 10 months ago

Got the same exception with the version 17.2.0. We received few crashes each week on Firebase Crashlytics

Fatal Exception: java.lang.UnsatisfiedLinkError: dlopen failed: library "libbarhopper_v3.so" not found
       at java.lang.Runtime.loadLibrary0(Runtime.java:1087)
       at java.lang.Runtime.loadLibrary0(Runtime.java:1008)
       at java.lang.System.loadLibrary(System.java:1664)
       at com.google.android.gms.internal.mlkit_vision_barcode_bundled.i.d(:1337)
       at com.google.android.gms.internal.mlkit_vision_barcode_bundled.h.onTransact(:20)
       at android.os.Binder.transact(Binder.java:1043)
       at c7.a.c0(:51)
       at rb.j.a(:21)
       at rb.g.s(:12)
       at x.b.call(:70)
       at p3.t.run(:74)
       at lb.o.run(:409)
       at z5.o.run(:28)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
       at z5.o.run(:53)
       at java.lang.Thread.run(Thread.java:923)

with Android 8.1, Android 11...

Do you have any news?

JustAClamber commented 9 months ago

I had the same problem on some phones and I reproduced it. After the APP successfully loads the dynamic module, if I enter the QR code scanning page without restarting the APP, this error will occur. But when I restarted the APP, this error disappeared.

I solved the issue with the following method:

mSplitInstallManager.registerListener {
            when (it.status()) {
                SplitInstallSessionStatus.INSTALLED -> {
                    // After the dynamic module is installed, use SplitInstallHelper.loadLibrary to load the so library
                    try {
                        val newContext = this.createPackageContext(this.packageName, 0)
                        SplitInstallHelper.loadLibrary(newContext, "barhopper_v3")
                    } catch (e: UnsatisfiedLinkError) {
                        e.printStackTrace()
                    }
                    // And then proceed with your work
                }
            }
}
VIPlearner commented 9 months ago

Same issue on 17.3.0

mtali commented 9 months ago

I am experiencing the same issue

Fatal Exception: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.jaza.starapp-sNxEvWUe2J-cW7rdvWziDw==/base.apk"],nativeLibraryDirectories=[/data/app/com.jaza.starapp-sNxEvWUe2J-cW7rdvWziDw==/lib/arm, /system/lib]]] couldn't find "libbarhopper_v3.so"
       at java.lang.Runtime.loadLibrary0(Runtime.java:1067)
       at java.lang.Runtime.loadLibrary0(Runtime.java:1007)
       at java.lang.System.loadLibrary(System.java:1667)
       at com.google.android.libraries.barhopper.BarhopperV3.<init>(BarhopperV3.java:1)
       at com.google.mlkit.vision.barcode.bundled.internal.zzb.zzc(zzb.java:1)
       at com.google.android.gms.internal.mlkit_vision_barcode_bundled.zzbk.zza(com.google.mlkit:barcode-scanning@@17.2.0:9)
       at com.google.android.gms.internal.mlkit_vision_barcode_bundled.zzb.onTransact(com.google.mlkit:barcode-scanning@@17.2.0:3)
       at android.os.Binder.transact(Binder.java:914)
       at com.google.android.gms.internal.mlkit_vision_barcode.zza.zzc(zza.java:2)
       at com.google.android.gms.internal.mlkit_vision_barcode.zzvt.zze(zzvt.java:2)
       at com.google.mlkit.vision.barcode.internal.zzn.zza(com.google.android.gms:play-services-mlkit-barcode-scanning@@18.3.0:3)
       at com.google.mlkit.vision.barcode.internal.zzk.zze(com.google.android.gms:play-services-mlkit-barcode-scanning@@18.3.0:3)
       at com.google.mlkit.vision.barcode.internal.zzk.run(com.google.android.gms:play-services-mlkit-barcode-scanning@@18.3.0:1)
       at com.google.mlkit.vision.common.internal.MobileVisionBase.zza(MobileVisionBase.java:2)
       at com.google.mlkit.vision.common.internal.zza.call(zza.java:477)
       at com.google.mlkit.common.sdkinternal.ModelResource.zza(ModelResource.java:8)
       at com.google.mlkit.common.sdkinternal.zzn.run(zzn.java:74)
       at com.google.mlkit.common.sdkinternal.zzt.run(zzt.java:2)
       at com.google.mlkit.common.sdkinternal.MlKitThreadPool.zze(MlKitThreadPool.java:4)
       at com.google.mlkit.common.sdkinternal.MlKitThreadPool.zzc(MlKitThreadPool.java:1)
       at com.google.mlkit.common.sdkinternal.zzk.run(zzk.java:28)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
       at com.google.mlkit.common.sdkinternal.MlKitThreadPool.zzd(MlKitThreadPool.java:2)
       at com.google.mlkit.common.sdkinternal.zzi.run(zzi.java:53)
       at java.lang.Thread.run(Thread.java:919)

Did anyone find a solution for this

rakesh1988 commented 8 months ago

I had the same problem on some phones and I reproduced it. After the APP successfully loads the dynamic module, if I enter the QR code scanning page without restarting the APP, this error will occur. But when I restarted the APP, this error disappeared.

I solved the issue with the following method:

mSplitInstallManager.registerListener {
            when (it.status()) {
                SplitInstallSessionStatus.INSTALLED -> {
                    // After the dynamic module is installed, use SplitInstallHelper.loadLibrary to load the so library
                    try {
                        val newContext = this.createPackageContext(this.packageName, 0)
                        SplitInstallHelper.loadLibrary(newContext, "barhopper_v3")
                    } catch (e: UnsatisfiedLinkError) {
                        e.printStackTrace()
                    }
                    // And then proceed with your work
                }
            }
}

@JustAClamber can i check with you what is the reason to use barhopper_v3 and not libbarhopper_v3

MirzaUkas commented 6 months ago

I had the same issue occurs on 17.1.0 when combined with Dynamic Feature Module. The error happens when the scanner is first opened after installing the dynamic module, but the problem disappears after reopening the app.

I've already tried @JustAClamber solution but still not working using SplitInstallHelper.loadLibrary with these libs name barhopper_v3, libbarhopper_v3, libbarhopper_v3.so

Device: Xiaomi Poco Android 13 Stacktrace:

Fatal Exception: java.lang.UnsatisfiedLinkError: dlopen failed: library "/data/app/~~dN3IwLAb0nOkFHrE9NC9Wg==/my.package.name0fAgeOGWPuquRe82SQ==/split_config.arm64_v8a.apk!/lib/arm64-v8a/libbarhopper_v3.so" not found
       at java.lang.Runtime.loadLibrary0(Runtime.java:1082)
       at java.lang.Runtime.loadLibrary0(Runtime.java:1003)
       at java.lang.System.loadLibrary(System.java:1661)
       at com.google.android.libraries.barhopper.BarhopperV3.<init>(com.google.mlkit:barcode-scanning@@17.1.0:1)
       at com.google.mlkit.vision.barcode.bundled.internal.zzb.zzc(zzb.java:1)
       at com.google.android.gms.internal.mlkit_vision_barcode_bundled.zzbk.zza(com.google.mlkit:barcode-scanning@@17.1.0:9)
       at com.google.android.gms.internal.mlkit_vision_barcode_bundled.zzb.onTransact(com.google.mlkit:barcode-scanning@@17.1.0:3)
       at android.os.Binder.transact(Binder.java:1169)
       at com.google.android.gms.internal.mlkit_vision_barcode.zza.zzc(zza.java:2)
       at com.google.android.gms.internal.mlkit_vision_barcode.zzsw.zze(zzsw.java:2)
       at com.google.mlkit.vision.barcode.internal.zzl.zza(com.google.android.gms:play-services-mlkit-barcode-scanning@@18.2.0:3)
       at com.google.mlkit.vision.barcode.internal.zzi.zze(com.google.android.gms:play-services-mlkit-barcode-scanning@@18.2.0:3)
       at com.google.mlkit.vision.barcode.internal.zzi.run(com.google.android.gms:play-services-mlkit-barcode-scanning@@18.2.0:1)
       at com.google.mlkit.vision.common.internal.MobileVisionBase.zza(MobileVisionBase.java:2)
       at com.google.mlkit.vision.common.internal.zza.call(com.google.mlkit:vision-common@@17.3.0:60)
       at com.google.mlkit.common.sdkinternal.ModelResource.zza(ModelResource.java:8)
       at com.google.mlkit.common.sdkinternal.zzn.run(com.google.mlkit:common@@18.7.0:49)
       at com.google.mlkit.common.sdkinternal.zzt.run(com.google.mlkit:common@@18.7.0:2)
       at com.google.mlkit.common.sdkinternal.MlKitThreadPool.zze(MlKitThreadPool.java:4)
       at com.google.mlkit.common.sdkinternal.MlKitThreadPool.zzc(MlKitThreadPool.java:1)
       at com.google.mlkit.common.sdkinternal.zzk.run(com.google.mlkit:common@@18.7.0:24)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
       at com.google.mlkit.common.sdkinternal.MlKitThreadPool.zzd(MlKitThreadPool.java:2)
       at com.google.mlkit.common.sdkinternal.zzi.run(com.google.mlkit:common@@18.7.0:13)
       at java.lang.Thread.run(Thread.java:1012)
henriquehsv commented 1 month ago

Hey all, could you check if this is still happening on the latest version of MLKit? We've reported this issue to Google and got some traction in getting it fixed.

TL;DR; this is an issue with Android's class loader that has been fixed in Android 15. There's already another fix on MLKit's newest version.

https://issuetracker.google.com/issues/346717090

tamimattafi commented 1 month ago

Getting crash reports with this issue from OnePlus8Pro Android 11 using 17.3.0

Fatal Exception: java.lang.UnsatisfiedLinkError
dlopen failed: library "libbarhopper_v3.so" not found

java.lang.Runtime.loadLibrary0 (Runtime.java:1115)
java.lang.Runtime.loadLibrary0 (Runtime.java:1035)
java.lang.System.loadLibrary (System.java:1664)
com.google.android.libraries.barhopper.BarhopperV3.<init> (BarhopperV3.java:1)
com.google.mlkit.vision.barcode.bundled.internal.zza.zzd (com.google.mlkit:barcode-scanning@@17.3.0:1)
com.google.android.gms.internal.mlkit_vision_barcode_bundled.zzbm.zza (com.google.mlkit:barcode-scanning@@17.3.0:20)
com.google.android.gms.internal.mlkit_vision_barcode_bundled.zzb.onTransact (com.google.mlkit:barcode-scanning@@17.3.0:3)
android.os.Binder.transact (Binder.java:1043)
com.google.android.gms.internal.mlkit_vision_barcode.zza.zzc (com.google.android.gms:play-services-mlkit-barcode-scanning@@18.3.1:2)
com.google.android.gms.internal.mlkit_vision_barcode.zzyl.zze (com.google.android.gms:play-services-mlkit-barcode-scanning@@18.3.1:2)
com.google.mlkit.vision.barcode.internal.zzo.zza (com.google.android.gms:play-services-mlkit-barcode-scanning@@18.3.1:3)
com.google.mlkit.vision.barcode.internal.zzl.zze (com.google.android.gms:play-services-mlkit-barcode-scanning@@18.3.1:3)
com.google.mlkit.vision.barcode.internal.zzl.run (com.google.android.gms:play-services-mlkit-barcode-scanning@@18.3.1:1)
com.google.mlkit.vision.common.internal.MobileVisionBase.zza (MobileVisionBase.java:2)
com.google.mlkit.vision.common.internal.zza.call (zza.java:31)
com.google.mlkit.common.sdkinternal.ModelResource.zza (ModelResource.java:8)
com.google.mlkit.common.sdkinternal.zzn.run (zzn.java:75)
com.google.mlkit.common.sdkinternal.zzt.run (zzt.java:2)
com.google.mlkit.common.sdkinternal.MlKitThreadPool.zze (MlKitThreadPool.java:4)
com.google.mlkit.common.sdkinternal.MlKitThreadPool.zzc (MlKitThreadPool.java:1)
com.google.mlkit.common.sdkinternal.zzi.run (zzi.java:43)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
com.google.mlkit.common.sdkinternal.MlKitThreadPool.zzd (MlKitThreadPool.java:2)
com.google.mlkit.common.sdkinternal.zzk.run (zzk.java:18)