Flipper: Crashes on emulator

Created on 17 Dec 2019  路  13Comments  路  Source: facebook/flipper

馃悰 Bug Report

Crashes on emulator. It's getting really difficult to justify Flipper, a debug tool shouldn't crash and block the development process.

To Reproduce

Build & Run

Environment

Emulator: Pixel 3 API 28, x86
Flipper: 0.30.1
Soloader: 0.8.0

    com.facebook.soloader.SoLoader$WrongAbiError: APK was built for a different platform
        at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:645)
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:577)
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:525)
        at com.facebook.soloader.NativeLoaderToSoLoaderDelegate.loadLibrary(NativeLoaderToSoLoaderDelegate.java:24)
        at com.facebook.soloader.nativeloader.NativeLoader.loadLibrary(NativeLoader.java:43)
        at com.facebook.jni.HybridData.<clinit>(HybridData.java:31)
        at com.facebook.flipper.android.FlipperThread.run(FlipperThread.java:25)
     Caused by: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libfbjni.so caused by: dlopen failed: "/data/data/de.zalon.android.debug/lib-main/libfbjni.so" has unexpected e_machine: 40 (EM_ARM)
        at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:789)
        at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:639)
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:577)聽
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:525)聽
        at com.facebook.soloader.NativeLoaderToSoLoaderDelegate.loadLibrary(NativeLoaderToSoLoaderDelegate.java:24)聽
        at com.facebook.soloader.nativeloader.NativeLoader.loadLibrary(NativeLoader.java:43)聽
        at com.facebook.jni.HybridData.<clinit>(HybridData.java:31)聽
        at com.facebook.flipper.android.FlipperThread.run(FlipperThread.java:25)聽
E/AndroidRuntime: FATAL EXCEPTION: FlipperConnectionThread
    Process: de.zalon.android.debug, PID: 13538
    java.lang.NoClassDefFoundError: <clinit> failed for class com.facebook.flipper.android.EventBase; see exception in other thread
        at com.facebook.flipper.android.FlipperThread.run(FlipperThread.java:25)
E/CrashLogHandler: Stack trace: java.lang.NoClassDefFoundError: <clinit> failed for class com.facebook.flipper.android.EventBase; see exception in other thread
        at com.facebook.flipper.android.FlipperThread.run(FlipperThread.java:25)
E/CrashLogHandler: Stack trace: com.facebook.soloader.SoLoader$WrongAbiError: APK was built for a different platform
        at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:645)
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:577)
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:525)
        at com.facebook.soloader.NativeLoaderToSoLoaderDelegate.loadLibrary(NativeLoaderToSoLoaderDelegate.java:24)
        at com.facebook.soloader.nativeloader.NativeLoader.loadLibrary(NativeLoader.java:43)
        at com.facebook.jni.HybridData.<clinit>(HybridData.java:31)
        at com.facebook.flipper.android.FlipperThread.run(FlipperThread.java:25)
     Caused by: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libfbjni.so caused by: dlopen failed: "/data/data/de.zalon.android.debug/lib-main/libfbjni.so" has unexpected e_machine: 40 (EM_ARM)
        at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:789)
        at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:639)
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:577)聽
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:525)聽
        at com.facebook.soloader.NativeLoaderToSoLoaderDelegate.loadLibrary(NativeLoaderToSoLoaderDelegate.java:24)聽
        at com.facebook.soloader.nativeloader.NativeLoader.loadLibrary(NativeLoader.java:43)聽
        at com.facebook.jni.HybridData.<clinit>(HybridData.java:31)聽
        at com.facebook.flipper.android.FlipperThread.run(FlipperThread.java:25)聽
Stale

Most helpful comment

go to android>app inside app delete build folder and rebuild the application again it worked for me very well.
Also you can look for gradlew clean

All 13 comments

Hello, i have the same problem.
Here are my dependencies:

debugImplementation 'com.facebook.flipper:flipper:0.30.1'
debugImplementation 'com.facebook.soloader:soloader:0.8.0'
debugImplementation 'com.facebook.flipper:flipper-network-plugin:0.30.1'

Tried on emulators with x86_64 and x86 versions.
Are there any chances for fixing this?

Is this for a React Native project? In that case the version of flipper should be kept lower, as described here: https://fbflipper.com/docs/getting-started.html#android (we are still working on a solution, but it is quite involved)

It's a regular android project, not RN. One note, it works with the same x86 emulator but API 29, instead of 28.

For now it should be safe to diverge the versions of Flipper itself, and the application plugin (the api has been stable for a very long time). I think the build issue is on @passy's radar.

Also @passy , Is there any way I can use higher flipper on React Native.

@gengjiawen Not easily. We're working on it in https://github.com/facebook/react-native/issues/27565

@gengjiawen Not easily. We're working on it in facebook/react-native#27565

Is it because react native use fbjni too. Duplicate code since react native include the source code ?

Maybe remove fbjni source code from react native repo and use https://github.com/facebookincubator/fbjni as gradle dependency ? Is react native has some hack in it ?

@gengjiawen Yes, that's exactly what I'm trying to do at the moment. :) Hopefully we'll get this landed soon.

We had a very similar problem in our Android builds. When inspecting the APK we noticed that the correct "so" libraries were not being included in the "lib/**" directories. It occured when we went from version "0.28.0" to "0.30.0" of the Flipper SDK.

We actually had to completely get rid of the library cache (ie. delete folders "~/.gradle/cache", "app/build" and rebuild everything). I thought deleting the entire cache would cause a really long build time but it was only a few minutes longer.

Not exactly sure why this worked but the problem has not reappeared.

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

go to android>app inside app delete build folder and rebuild the application again it worked for me very well.
Also you can look for gradlew clean

Was this page helpful?
0 / 5 - 0 ratings

Related issues

usrbowe picture usrbowe  路  4Comments

orlandobustamantep picture orlandobustamantep  路  3Comments

paschaldev picture paschaldev  路  3Comments

keshavamurthy1 picture keshavamurthy1  路  4Comments

usrbowe picture usrbowe  路  3Comments