WrongAbiError - Fatal Exception on launch of x86_64 Android Emulator with Flipper integration
See original GitHub issue🐛 Bug Report
I am unable to launch my built app w/ Flipper support in an Android x86 based emulator.
I can run on any ARM device, with no issues, just Android x86 / x86_64 emulators fail.
I appear to have all the needed pieces within my Gradle file regarding ABI support:
ndk {
abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
Output log from console on emulator launch:
W/System.err: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/data/com.target.ui.debug/lib-main/libfbjni.so" has unexpected e_machine: 40 (EM_ARM)
at java.lang.Runtime.load0(Runtime.java:928)
at java.lang.System.load(System.java:1633)
at com.facebook.soloader.SoLoader$1.load(SoLoader.java:393)
at com.facebook.soloader.DirectorySoSource.loadLibraryFrom(DirectorySoSource.java:77)
at com.facebook.soloader.UnpackingSoSource.loadLibrary(UnpackingSoSource.java:458)
at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:731)
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/SoLoader: couldn't find DSO to load: libfbjni.so caused by: dlopen failed: "/data/data/com.target.ui.debug/lib-main/libfbjni.so" has unexpected e_machine: 40 (EM_ARM)
E/AndroidRuntime: FATAL EXCEPTION: FlipperConnectionThread
Process: com.target.ui.debug, PID: 3250
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/com.target.ui.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: FlipperEventBaseThread
Process: com.target.ui.debug, PID: 3250
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)
To Reproduce
Unknown, seems to only occur on some workstations for our Android app team.
Environment
Android Studio 3.5.2
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Android Emulator unable to connect to Flipper - Stack Overflow
In the flipper application: Open the Settings from the bottom left gear wheel, then "Settings"; Change the "Android SDK location" value to ...
Read more >Adding Flipper to Android apps with Gradle
To set up Flipper for Android, you need to add the necessary dependencies to your app, initialize the Flipper client and enable the...
Read more >flipper Crashes on emulator - TypeScript - GitAnswer
3 Answer: · go to android>app inside app delete build folder and rebuild the application again it worked for me very well. Also...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We were able to get some more data on this. It looks like it may be dependent on which Android API level your emulator is using. We got word that for some users, switching emulators help resolve the issue and so far my own testing has shown:
I am going to apologize in advance for not being able to provide a repro repo.
On a 20+ person team, this issue is occurring on 2 workstations.
That leads me to believe that it isn’t necessarily a repo based issue, but something environmental on the given machines?
I have tried things like repairing NDK, deleting all Gradle deps and forcing new, … all to no avail.
Is there some core part of the
SoLoader
and/or AS / Gradle integration steps which could go bad? Is there some other Gradle / AS config issue which could lead to this independent of repo / source files? Is there some core permission issue with folders? … Looking for anySoLoader
help on this one.Thank you for any consideration, and for your valuable time spent on this so far. I am still brainstorming / digging on my side, but haven’t surfaced any solutions for over a week since this started occurring.
I am working around it by just direct targeting an ARM based Android phone which is always connected, which seems to work every build.