hermes icon indicating copy to clipboard operation
hermes copied to clipboard

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

Open hopestar90 opened this issue 1 year ago • 4 comments

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.

  • Where: Build file '/Users/victor.chi/github_hermes_workspace/shopee-hermes/android/build.gradle' line: 35

  • What went wrong: A problem occurred evaluating root project 'Hermes'.

Hermes host build not found. Expression: (hermesC != ). Values: hermesC =

  • Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

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

hopestar90 avatar Jul 30 '24 03:07 hopestar90

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 =".

tmikov avatar Jul 31 '24 03:07 tmikov

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?

hopestar90 avatar Jul 31 '24 07:07 hopestar90

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

tmikov avatar Jul 31 '24 18:07 tmikov

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 =".

hopestar90 avatar Aug 01 '24 03:08 hopestar90