Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Crash] can't find libhermes.so in certain cases (64bit?) #76

Closed
MayrPatrick opened this issue Aug 1, 2019 · 4 comments
Closed

[Crash] can't find libhermes.so in certain cases (64bit?) #76

MayrPatrick opened this issue Aug 1, 2019 · 4 comments

Comments

@MayrPatrick
Copy link

MayrPatrick commented Aug 1, 2019

Context:

we're having a hybrid app (native + RN), that is using React Native 0.60.4 and Hermes for the RN part.

Current behavior/problem:

the release build (universal APK) that incorporates the Hermes "adaptions" (= switch) is working fine for a big chunk of our userbase but crashes for the others.

crashMessage:
mostly: couldn't find DSO to load: libhermes.so,
whereas other users have a slightly different message:

couldn't find DSO to load: libhermes.so caused by: couldn't find DSO to load: libc++_shared.so caused by: dlopen failed:"/data/data/.../lib-3/libc++_shared.so" is 32-bit instead of 64-bit

(could also be lib-1, lib-2, ...).

Additional info:

  • crashLocation: SourceFile line 738 in com.facebook.soloader.SoLoader.ॱ
  • crashException: java.lang.UnsatisfiedLinkError

What we did:

a.) switching the "enableHermes" flag from false to true

b.) add a couple of pickFirst entries to the build.gradle file

packagingOptions {
        pickFirst 'lib/x86/libc++_shared.so'
        pickFirst 'lib/arm64-v8a/libc++_shared.so'
        pickFirst 'lib/x86_64/libc++_shared.so'
        pickFirst 'lib/armeabi-v7a/libc++_shared.so'
    }

(similar to what facebook/react-native#25601 (comment) suggested/did)

c.) we had to order the dependencies within the dependencies.gradle file as follows (excerpt)

dependencies {
	api 'com.facebook.react:react-native:0.59.10'
	// Workaround for using Hermes as JS engine
	api fileTree(dir: 'libs', include: '*.aar')
	api 'com.facebook.react:react-native:0.60.4'
@kele86838437
Copy link

Maybe your project has different so files between 32 bit and 64 bit.

@MayrPatrick
Copy link
Author

they seem to be correct :-/

I pulled the (installed) apk from a phone via adb pull ... and after unpacking it, compared the libs with the ones from the hermes-release.aar package. They are identical and therefore I'm thinking that those are fine.

@gbalduzzi
Copy link

I'm facing a similar situation. I'm using react native 0.62.0 and in my app/build.gradle I had to set those pickFirst to solve some linking problems:

packagingOptions {
        pickFirst 'lib/x86_64/libjsc.so'
        pickFirst 'lib/x86/libjsc.so'
        pickFirst 'lib/arm64-v8a/libjsc.so'
        pickFirst 'lib/armeabi-v7a/libjsc.so'
        pickFirst "lib/armeabi-v7a/libc++_shared.so"
        pickFirst "lib/arm64-v8a/libc++_shared.so"
        pickFirst "lib/x86/libc++_shared.so"
        pickFirst "lib/x86_64/libc++_shared.so"
    }

I correctly published my app on the store and now I'm getting crash on some devices with android 5 and android 6.

Interestingly enough, all the devices I got the error with were running an Intel Atom chipset (not sure if relevant).

The error:

java.lang.UnsatisfiedLinkErrorSoLoader.java:789
couldn't find DSO to load: libhermes.so caused by: APK was built for a different platform

@roots-ai
Copy link

Any updates herE?

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

No branches or pull requests

5 participants