facebook / hermes

A JavaScript engine optimized for running React Native.
https://hermesengine.dev/
MIT License
9.72k stars 623 forks source link

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

Open LiShiqii opened 1 month ago

LiShiqii commented 1 month ago

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

tmikov commented 1 month ago

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