question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hermes not working on Android

See original GitHub issue

Description

Premise: we have read that hermes is not yet supported on tvOS, but we expected it to work correctly on Android.

When enabling hermes through the android build.gradle

project.ext.react = [
  enableHermes: true
]

the app is not compiling because the hermes package is not found, throwing the following error.

Could not determine the dependencies of task ':app:compilePlayStoreDebugJavaWithJavac'.
Could not resolve all task dependencies for configuration ':app:playStoreDebugCompileClasspath'.
Could not find any matches for com.facebook.react:hermes-engine:+ as no versions of com.facebook.react:hermes-engine are available.
     Required by:
         project :app

The responsible code for this is the following part of the build.gradle of the app to include the hermes dependency

if (enableHermes) {
  implementation("com.facebook.react:hermes-engine:+") {
    exclude group: 'com.facebook.fbjni'
  }
}

One way to workaround this, is to change the build.gradle dependency to

if (enableHermes) {
        def hermesPath = "../../node_modules/hermes-engine/android/";
        debugImplementation files(hermesPath + "hermes-debug.aar")
        releaseImplementation files(hermesPath + "hermes-release.aar")
    }

to pick the hermes package from the node_modules themself. But this is not the correct way and also it causes other issues later on. So we need to able to use the correct implementation of implementation("com.facebook.react:hermes-engine:+"), which doesn’t work.

Version

0.69.5-0

Output of npx react-native info

System: OS: macOS 12.6 CPU: (16) x64 Intel® Core™ i9-9880H CPU @ 2.30GHz Memory: 19.84 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 14.20.0 - /usr/local/opt/node@14/bin/node Yarn: 1.22.18 - /usr/local/bin/yarn npm: 6.14.17 - /usr/local/opt/node@14/bin/npm Watchman: Not Found Managers: CocoaPods: 1.11.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0 Android SDK: Not Found IDEs: Android Studio: 2021.2 AI-212.5712.43.2112.8609683 Xcode: 14.0/14A309 - /usr/bin/xcodebuild Languages: Java: Not Found npmPackages: @react-native-community/cli: Not Found react: 18.2.0 => 18.2.0 react-native: Not Found react-native-macos: Not Found react-native-tvos: 0.69.5 npmGlobalPackages: react-native: Not Found

Steps to reproduce

The issue is happening also in a freshly created project trough CLI

$ react-native init TestApp --template=react-native-tvos@latest

Snack, code example, screenshot, or link to a repository

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
douglowdercommented, Sep 24, 2022

Fixed in 0.69.5-1

1reaction
douglowdercommented, Sep 23, 2022

I think I have found the problem – RN 0.69 now requires an extra step before NPM publish. I will push out a new version and that should hopefully fix the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hermes does not work when extracting apk from android ...
Enabling Hermes on android builds configured to extract apk from app bundles (.abb) will freeze on app start. React Native version: System:
Read more >
How to fix hermes on android [closed] - react native
I have an existing react native app which even though I configure hermes in android/app/build.gradle and in proguard-rules won't work. What I ...
Read more >
Using Hermes
Hermes is an open-source JavaScript engine optimized for React Native. For many apps, using Hermes will result in improved start-up time, ...
Read more >
What to Expect From the Hermes Engine in React Native 0.70
React Native applications running on 0.70 will have Hermes enabled by default. ... On Android, edit your android/app/build.gradle file:
Read more >
SDK 46 ( 47 ) Hermes is not enabled
Please provide the following: was 46, now 47: Android / real device Hi I want to know why i cant debug ... No,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found