Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

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

Closed
frett opened this issue Feb 26, 2021 · 12 comments
Closed
Assignees

Comments

@frett
Copy link

frett commented Feb 26, 2021

🐛 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

@fantasy1022
Copy link

fantasy1022 commented Mar 1, 2021

I meet the same bug in 0.78.0.

@mweststrate
Copy link
Contributor

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

@passy
Copy link
Member

passy commented Mar 1, 2021

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.

@matheuskiser
Copy link

Same issue in 0.79.0.

@passy
Copy link
Member

passy commented Mar 3, 2021

Again, I will need a sample that repros this.

@zws33
Copy link

zws33 commented Mar 3, 2021

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.

@mweststrate
Copy link
Contributor

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

@steelahhh
Copy link

Running into this as well, created a minimal repro

@passy
Copy link
Member

passy commented Mar 4, 2021

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

@passy
Copy link
Member

passy commented Mar 4, 2021

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.

@passy
Copy link
Member

passy commented Mar 4, 2021

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. facebookincubator/fbjni#51

passy added a commit that referenced this issue Mar 4, 2021
Summary:
This should fix #1968

Test Plan:
Built our sample app; built the sample app provided in the repo as part
of the issue; locally released the Flipper artifacts and built the RN
app against it.
@sushantchoudhary
Copy link

sushantchoudhary commented Mar 5, 2021

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants