expo: [SDK 46] Can't build Android app on AppCenter if Hermes is enabled
Summary
Hi 👋 I can’t build Android app on AppCenter since SDK 46 if Hermes is enabled.
If I disable Hermes, it’s working on AppCenter. If I try to generate binary with Android Studio on my computer, it’s working too (with Hermes or without) I will send a message to AppCenter team, maybe it miss something on build environment.
Thanks for your help.
I have this error message:
> Task :expo-modules-core:extractReactNativeAARRelease
> Task :expo-modules-core:configureCMakeRelWithDebInfo[arm64-v8a]
Resolved com.google.prefab:cli:2.0.0 in :expo-modules-core:_internal_prefab_binary
C/C++: prefabcom.google.prefab.api.NoMatchingLibraryException: No compatible library found for //fbjni/fbjni. Rejected the following libraries:
C/C++: prefabandroid.arm64-v8a: User is using a static STL but library requires a shared STL
C/C++: prefabandroid.armeabi-v7a: User is targeting arm64-v8a but library is for armeabi-v7a
C/C++: prefabandroid.x86: User is targeting arm64-v8a but library is for x86
C/C++: prefabandroid.x86_64: User is targeting arm64-v8a but library is for x86_64
C/C++: release|arm64-v8a :CMake Warning (dev) in CMakeLists.txt:
C/C++: release|arm64-v8a : No project() command is present. The top-level CMakeLists.txt file must
C/C++: release|arm64-v8a : contain a literal, direct call to the project() command. Add a line of
C/C++: release|arm64-v8a : code such as
C/C++: release|arm64-v8a : project(ProjectName)
C/C++: release|arm64-v8a : near the top of the file, but after cmake_minimum_required().
C/C++: release|arm64-v8a : CMake is pretending there is a "project(Project)" command on the first
C/C++: release|arm64-v8a : line.
C/C++: release|arm64-v8a :This warning is for project developers. Use -Wno-dev to suppress it.
C/C++: release|arm64-v8a :CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
C/C++: release|arm64-v8a :Please set them or make sure they are set and tested correctly in the CMake files:
C/C++: release|arm64-v8a :HERMES_LIB
C/C++: release|arm64-v8a : linked by target "expo-modules-core" in directory /Users/runner/work/1/s/packages/app_name/node_modules/expo-modules-core/android
C/C++: release|arm64-v8a :CMake Generate step failed. Build files cannot be regenerated correctly.
> Task :expo-modules-core:configureCMakeRelWithDebInfo[arm64-v8a] FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':expo-modules-core:configureCMakeRelWithDebInfo[arm64-v8a]'.
> [CXX1405] error when building with cmake using /Users/runner/work/1/s/packages/app_name/node_modules/expo-modules-core/android/CMakeLists.txt: Build command failed.
Error while executing process /Users/runner/Library/Android/sdk/cmake/3.18.1/bin/cmake with arguments {-H/Users/runner/work/1/s/packages/app_name/node_modules/expo-modules-core/android -DCMAKE_SYSTEM_NAME=Android -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_SYSTEM_VERSION=27 -DANDROID_PLATFORM=android-27 -DANDROID_ABI=arm64-v8a -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a -DANDROID_NDK=/Users/runner/Library/Android/sdk/ndk/21.4.7075529 -DCMAKE_ANDROID_NDK=/Users/runner/Library/Android/sdk/ndk/21.4.7075529 -DCMAKE_TOOLCHAIN_FILE=/Users/runner/Library/Android/sdk/ndk/21.4.7075529/build/cmake/android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=/Users/runner/Library/Android/sdk/cmake/3.18.1/bin/ninja -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/Users/runner/work/1/s/packages/app_name/node_modules/expo-modules-core/android/build/intermediates/cxx/RelWithDebInfo/606m4m68/obj/arm64-v8a -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=/Users/runner/work/1/s/packages/app_name/node_modules/expo-modules-core/android/build/intermediates/cxx/RelWithDebInfo/606m4m68/obj/arm64-v8a -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_FIND_ROOT_PATH=/Users/runner/work/1/s/packages/app_name/node_modules/expo-modules-core/android/.cxx/RelWithDebInfo/606m4m68/prefab/arm64-v8a/prefab -B/Users/runner/work/1/s/packages/app_name/node_modules/expo-modules-core/android/.cxx/RelWithDebInfo/606m4m68/arm64-v8a -GNinja -DREACT_NATIVE_DIR=/Users/runner/work/1/s/packages/app_name/node_modules/react-native -DREACT_NATIVE_SO_DIR=/Users/runner/work/1/s/packages/app_name/node_modules/expo-modules-core/android/build/react-native-0*/jni -DREACT_NATIVE_TARGET_VERSION=69 -DBOOST_VERSION=1_76_0 -DFOR_HERMES=true -DHERMES_DIR=/Users/runner/work/1/s/packages/app_name/node_modules/hermes-engine}
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Users/runner/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Users/runner/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as
project(ProjectName)
near the top of the file, but after cmake_minimum_required().
CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
HERMES_LIB
linked by target "expo-modules-core" in directory /Users/runner/work/1/s/packages/app_name/node_modules/expo-modules-core/android
CMake Generate step failed. Build files cannot be regenerated correctly.
Managed or bare workflow? If you have ios/
or android/
directories in your project, the answer is bare!
bare
What platform(s) does this occur on?
Android
SDK Version (managed workflow only)
No response
Environment
expo-env-info 1.0.5 environment info:
System:
OS: macOS 12.4
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.16.0 - /usr/local/bin/node
Yarn: 3.2.2 - /usr/local/bin/yarn
npm: 8.11.0 - /usr/local/bin/npm
Watchman: 2022.05.16.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8609683
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
npmPackages:
expo: ~46.0.1 => 46.0.1
react: ^18.0.0 => 18.2.0
react-dom: ^18.2.0 => 18.2.0
react-native: ~0.69.3 => 0.69.3
react-native-web: ^0.18.7 => 0.18.7
npmGlobalPackages:
eas-cli: 0.8.1
expo-cli: 6.0.0
Expo Workflow: bare
Reproducible demo
Init a bare expo app, enable Hermes and try to build it with AppCenter. Sorry to not give repro, but the problem appears on AppCenter with minimal project setup.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 23 (5 by maintainers)
Commits related to this issue
- Add a missing gradle task dependency declaration The prepareHermes() task was missing a declaration for file dependencies, so builds that were run alongside a clean command failed, for example in App... — committed to EdwardDrapkin/expo by EdwardDrapkin 2 years ago
- Add a missing gradle task dependency declaration The prepareHermes() task was missing a declaration for file dependencies, so builds that were run alongside a clean command failed, for example in App... — committed to EdwardDrapkin/expo by EdwardDrapkin 2 years ago
Still having this issue
Hi @KrisLau , You’re right sorry. The link you post, solve my issue, thank you
Not sure if this is related to anyone’s problem here but just in case:
I’m facing a similar error
My version :
App works fine during local build and debugging with metrobundler, but when creating signed apk it shows error
For temporary use, you can use this patch pacakge
expo-modules-core+0.11.3.patch
that’s strange. i’ve tried to use AppCenter with hermes and it works for me. we would need a reproducible example repo for further investigation. or maybe it’s worth for you to try EAS Build