Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hermesCommand in 'Migrating to Expo modules' broken for React Native 0.69.x #86

Open
cameronmurphy opened this issue Sep 28, 2022 · 0 comments

Comments

@cameronmurphy
Copy link

cameronmurphy commented Sep 28, 2022

When upgrading to Expo 46 and React Native 0.69.5 the hermesCommand in android/app/build.gradle file broke our Android build. This hermesCommand is in the Migrating to Expo Modules doc.

This issue was masked by expo-updates complaining about 'No launchable update was found', so the app would crash on launch. When I removed expo-updates from the project it was instead throwing the error com.facebook.jni.CppException: Compiling JS failed: Wrong bytecode version. Expected 85 but got 84.

Now that I was able to find this issue, I found this related issue and was able to fix it:
facebook/react-native#34114

This happened because the Bare Workflow upgrade notes say to "Apply any relevant changes from the React Native Upgrade Helper" however the stock React Native android/app/build.gradle file does not override the hermesCommand, only Expo's version of android/app/build.gradle does.

Perhaps some kind of 'Expo Upgrade Helper' would be useful, to make it obvious how the supporting files should change, so tweaks like this one don't get missed. It's cumbersome to create fresh projects using create-expo-app and compare the files manually.

Instead of

hermesCommand: new File(["node", "--print", "require.resolve('hermes-engine/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + "/%OS-BIN%/hermesc",

it should be

hermesCommand: new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + "/sdks/hermesc/%OS-BIN%/hermesc",

This is what's now in android/app/build.gradle when you run npx create-expo-app -t bare-minimum.

ariccio added a commit to ariccio/COVID-CO2-tracker that referenced this issue Dec 17, 2022
Deal with bad `hermesCommand`? expo/fyi#86 (comment)

Was getting an error similar to OP, something like `com.facebook.jni.CppException: Compiling JS failed: Wrong bytecode version. Expected 85 but got 84`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant