hermes icon indicating copy to clipboard operation
hermes copied to clipboard

How to get libjsi.so and header files from hermes aar

Open LiShiqii opened this issue 1 year ago • 1 comments

Problem

We have a project to build hermes engine into Android app, and our Android app is not react, we want to use Hermes as a JS engine and using a wrapper to connect with our custom components. And After pull the hermes android from maven repo https://mvnrepository.com/artifact/com.facebook.react/hermes-android. We build the app, and only saw the header files for Hermes and didn't see where is the libjsi.so and its header files. And I did see the jsi file exists in https://mvnrepository.com/artifact/com.facebook.react/react-android, but we don't want to build that into our app since react-android contains lots of other unneeded dependencies for our app.

Solution

Is there a way to pull the libjsi.so and its header file from Hermes maven aar? Or what is the best practice to pull that into our non react Android app.

Additional Context

LiShiqii avatar Aug 16 '24 17:08 LiShiqii

Hi, if you are using Hermes outside of RN, you need to compile Hermes from source. You can see the steps for Android compilation here: https://github.com/facebook/hermes/blob/751d19feb44f6fba04707ffff9111af37dbde220/.circleci/config.yml#L54

tmikov avatar Aug 16 '24 22:08 tmikov

Hi, if you are using Hermes outside of RN, you need to compile Hermes from source. You can see the steps for Android compilation here:

https://github.com/facebook/hermes/blob/751d19feb44f6fba04707ffff9111af37dbde220/.circleci/config.yml#L54

I'm building Hermes from source by following the CI configuration, but the output doesn't include libjsi.so. How can I build it for arm64-v8a? (Sorry I'm new to C++).

leon60740 avatar Oct 24 '24 10:10 leon60740

Facing the same issue @tmikov any guidence? the built aar does not include libjsi.so

ammarahm-ed avatar Nov 16 '24 18:11 ammarahm-ed

Screenshot 2024-11-16 at 11 30 49 PM I think commenting this out will include libjsi.so

ammarahm-ed avatar Nov 16 '24 18:11 ammarahm-ed