facebook / hermes

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

Fail to build android dynamic lib 'libhermes.so' in branch 'origin/static_h' #1464

Open hopestar90 opened 1 month ago

hopestar90 commented 1 month ago

I want to build the dynamic lib 'libhermes.so' for android project in the branch 'origin/static_h', my step is as follow:

  1. I excute the command 'cmake -S hermes -B build_release -G Ninja -DCMAKE_BUILD_TYPE=Release'
  2. I excute the command 'cmake --build ./build_release' , after this I get the folder 'build_release'
  3. I excute the cmoonad 'cd $HERMES_WS_DIR/hermes/android && ./gradlew githubReleaseNoIntl'

After excute the step 3, I got the errors: FAILURE: Build failed with an exception.


Thanks a lot for telling me how to fix this error.

tmikov commented 1 month ago

Hi, the Android build relies on a build for the host system, which must already exists. This is necessary because part of the runtime is written in JavaScript and it needs a version of Hermes to compile it. That's why are seeing the error "Hermes host build not found. Expression: (hermesC != ). Values: hermesC =".

hopestar90 commented 1 month ago

Hi, the Android build relies on a build for the host system, which must already exists. This is necessary because part of the runtime is written in JavaScript and it needs a version of Hermes to compile it. That's why are seeing the error "Hermes host build not found. Expression: (hermesC != ). Values: hermesC =".

Thanks a lot~But I don’t know exactly how to do it. Is there any relevant doc that I can refer to?

tmikov commented 1 month ago

I don't know the details of the Android build, but I think the steps here should work: https://github.com/facebook/hermes/blob/main/.github/workflows/build.yml

hopestar90 commented 1 month ago

I don't know the details of the Android build, but I think the steps here should work: https://github.com/facebook/hermes/blob/main/.github/workflows/build.yml

I do as the doc https://github.com/facebook/hermes/blob/main/.github/workflows/build.yml, the steps are: 1 I excute the command 'cmake -S hermes -B build_release -G Ninja -DCMAKE_BUILD_TYPE=Release' 2 I excute the command 'cmake --build ./build_release' , after this I get the folder 'build_release' 3 I excute the cmoonad 'cd $HERMES_WS_DIR/hermes/android && ./gradlew githubReleaseNo

but I also got the errors, "Hermes host build not found. Expression: (hermesC != ). Values: hermesC =".