Flipper: Flipper 0.77.0 crashes on Android with "couldn't find DSO to load: libfbjni.so"

Created on 26 Feb 2021  路  12Comments  路  Source: facebook/flipper

馃悰 Bug Report

Flipper 0.77.0 crashes on Android app start for me with the following error:

SoLoader: About to load: libfbjni.so
SoLoader: libfbjni.so not found on /data/data/org.keynote.godtools.android.debug/lib-main
SoLoader: libfbjni.so not found on /data/data/org.keynote.godtools.android.debug/lib-0
SoLoader: libfbjni.so not found on /data/app/~~5H3GkFBLiByBhxtWu6I1Kg==/org.keynote.godtools.android.debug-BKgZ7upyea_oTOsUi3kiVQ==/lib/x86_64
SoLoader: libfbjni.so not found on /vendor/lib64
SoLoader: libfbjni.so not found on /system/lib64
SoLoader: couldn't find DSO to load: libfbjni.so
SoLoader:   SoSource 0: com.facebook.soloader.ApkSoSource[root = /data/data/org.keynote.godtools.android.debug/lib-main flags = 1]
SoLoader:   SoSource 1: com.facebook.soloader.ApkSoSource[root = /data/data/org.keynote.godtools.android.debug/lib-0 flags = 1]
SoLoader:   SoSource 2: com.facebook.soloader.DirectorySoSource[root = /data/app/~~5H3GkFBLiByBhxtWu6I1Kg==/org.keynote.godtools.android.debug-BKgZ7upyea_oTOsUi3kiVQ==/lib/x86_64 flags = 0]
SoLoader:   SoSource 3: com.facebook.soloader.DirectorySoSource[root = /vendor/lib64 flags = 2]
SoLoader:   SoSource 4: com.facebook.soloader.DirectorySoSource[root = /system/lib64 flags = 2]
SoLoader:   Native lib dir: /data/app/~~5H3GkFBLiByBhxtWu6I1Kg==/org.keynote.godtools.android.debug-BKgZ7upyea_oTOsUi3kiVQ==/lib/x86_64
SoLoader:  result: 0
AndroidRuntime: FATAL EXCEPTION: FlipperEventBaseThread
AndroidRuntime: Process: org.keynote.godtools.android.debug, PID: 27218
AndroidRuntime: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libfbjni.so
AndroidRuntime:     SoSource 0: com.facebook.soloader.ApkSoSource[root = /data/data/org.keynote.godtools.android.debug/lib-main flags = 1]
AndroidRuntime:     SoSource 1: com.facebook.soloader.ApkSoSource[root = /data/data/org.keynote.godtools.android.debug/lib-0 flags = 1]
AndroidRuntime:     SoSource 2: com.facebook.soloader.DirectorySoSource[root = /data/app/~~5H3GkFBLiByBhxtWu6I1Kg==/org.keynote.godtools.android.debug-BKgZ7upyea_oTOsUi3kiVQ==/lib/x86_64 flags = 0]
AndroidRuntime:     SoSource 3: com.facebook.soloader.DirectorySoSource[root = /vendor/lib64 flags = 2]
AndroidRuntime:     SoSource 4: com.facebook.soloader.DirectorySoSource[root = /system/lib64 flags = 2]
AndroidRuntime:     Native lib dir: /data/app/~~5H3GkFBLiByBhxtWu6I1Kg==/org.keynote.godtools.android.debug-BKgZ7upyea_oTOsUi3kiVQ==/lib/x86_64
AndroidRuntime:  result: 0
AndroidRuntime:     at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:918)
AndroidRuntime:     at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:740)
AndroidRuntime:     at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:654)
AndroidRuntime:     at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:634)
AndroidRuntime:     at com.facebook.soloader.NativeLoaderToSoLoaderDelegate.loadLibrary(NativeLoaderToSoLoaderDelegate.java:29)
AndroidRuntime:     at com.facebook.soloader.nativeloader.NativeLoader.loadLibrary(NativeLoader.java:51)
AndroidRuntime:     at com.facebook.soloader.nativeloader.NativeLoader.loadLibrary(NativeLoader.java:30)
AndroidRuntime:     at com.facebook.jni.HybridData.<clinit>(HybridData.java:34)
AndroidRuntime:     at com.facebook.flipper.android.FlipperThread.run(FlipperThread.java:25)
AndroidRuntime: FATAL EXCEPTION: FlipperConnectionThread
AndroidRuntime: Process: org.keynote.godtools.android.debug, PID: 27218
AndroidRuntime: java.lang.NoClassDefFoundError: <clinit> failed for class com.facebook.flipper.android.EventBase; see exception in other thread
AndroidRuntime:     at com.facebook.flipper.android.FlipperThread.run(FlipperThread.java:25)

downgrading back to Flipper 0.76.0 works successfully.

This is a regular Android app and not a RN app

Most helpful comment

Running into this as well, created a minimal repro

All 12 comments

I meet the same bug in 0.78.0.

cc @passy might this be related to the recent build setup changes for fbjni?

Yes, there have been changes to the distribution but I tested this with our sample apps and it worked without additional changes. Would be great to have a sample project that repros the crash.

Same issue in 0.79.0.

Again, I will need a sample that repros this.

I experienced this issue with my app, as well as the sample app in the repo. The latest version that worked for me was 0.76.0.

If the issue is also experienced with our sample app, it might be an environmental issue, as we'll always build that one as well in our CI were it succeeds happily, for example https://github.com/facebook/flipper/runs/2025667652. So it might good to compare your local setup (gradle, ndk, jdk versions etc) against our CI setup which is a pretty isolated but working setup: https://github.com/facebook/flipper/blob/master/.github/workflows/android-sample.yml

Running into this as well, created a minimal repro

Thanks, @steelahhh. I'll check that out today.

That helped a lot, @steelahhh. Thanks for that. It looks like prefab behaves differently when used through an exported package and when consumed as part of the same gradle project.

Ultimately, this is something the Android Gradle plugin will need to fix. For now, what we could do is include libfbjni.so as part of the Flipper package. That feels a little icky to me, but would at least help as a workaround here. I'll check out some other options but that might be what we need to do.

I'll address this through a new fbjni release instead. In my testing this seems to work both in the Flipper repo and with your app. https://github.com/facebookincubator/fbjni/pull/51

Ran into this issue with 0.79.0. Is this fixed with 0.79.1 release?
Works with 0.79.1 馃憤

Was this page helpful?
0 / 5 - 0 ratings