[0.61.2] Hermes does not support custom variants
See original GitHub issueThe logic in react.gradle
relies on the variant name to contain release
in order for Hermes to build properly.
In my case, I had a variant called staging
. In order for hermes to work for me, I had to rename my variant to releasestaging
. Instead, we should be able to pass required options in through app/build.gradle
, without having to rename the variant.
React Native version:
System: OS: macOS Mojave 10.14.6 CPU: (16) x64 Intel® Core™ i9-9980HK CPU @ 2.40GHz Memory: 2.35 GB / 32.00 GB Shell: 5.3 - /bin/zsh Binaries: Node: 10.18.1 - ~/.nvm/versions/node/v10.18.1/bin/node Yarn: 1.17.3 - /usr/local/bin/yarn npm: 6.13.4 - ~/.nvm/versions/node/v10.18.1/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1 Android SDK: API Levels: 23, 26, 27, 28, 29 Build Tools: 27.0.3, 28.0.3, 29.0.2 System Images: android-28 | Google Play Intel x86 Atom IDEs: Android Studio: 3.5 AI-191.8026.42.35.5791312 Xcode: 11.2.1/11B500 - /usr/bin/xcodebuild npmPackages: react: 16.9.0 => 16.9.0 react-native: 0.61.2 => 0.61.2
Steps To Reproduce
- Create new React Native project
- Create custom variant that does not include
release
in its name - Enable hermes
- Build to device and see error when launching app:
couldn't find DSO to load: libhermes-executor-debug.so caused by: dlopen failed: cannot locate symbol "_ZTIN8facebook6hermes8debugger13EventObserverE" referenced by "/data/app/com.freeplay-q767SRYD9UinoTtLFqtR4Q==/lib/arm64/libhermes-inspector.so"...
Describe what you expected to happen: Expect to build to device and the app to run successfully with Hermes enabled.
Snack, code example, screenshot, or link to a repository:
Example failing android/app/build.gradle. Replacing staging
with releasestaging
fixes the issue.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:8 (2 by maintainers)
Top GitHub Comments
The gradle hacks you refer to are also causing issues with hermes and the android gradle plugin v3.5. I’m not a gradle expert (I find their patterns hard to work with), but I think I’ve worked out how to improve this. But, it will take a few weeks for me to get to it. Stay tuned.
I tried to make this work better, but I wasn’t able to. If someone who is better at gradle than I am can submit a PR to improve this, that would be really helpful.