Open lazh opened 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
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.
facing the same crash, any way to prevent the lib from crashing , consumers are having bad experience.
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?
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.
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?
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)
same issue on 17.0.3. has anyone found a solution to this?
Searching. Noticed this bug on universal apk as well, so the bug is reproduced by app bundle/universal apk
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.
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.
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.
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?
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
}
}
}
Same issue on 17.3.0
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
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
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)
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.
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)
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