Closed chuckwu0 closed 2 years ago
and found another bug:
FlatList【onEndReached】 not work on Android at 0.69.1
which 0.68.x is work.
Description
com.facebook.jni.CppException: Compiling JS failed: Wrong bytecode version. Expected 85 but got 84 Buffer size 3419342 starts with: c61fbc03c103191f540000005641aaed and has protection mode(s): r--p at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27) at android.os.Looper.loop(Looper.java:236) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
Version
0.69.1
Output of
npx react-native info
System: OS: macOS 12.4 CPU: (8) x64 Apple M1 Memory: 35.58 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.13.2 - /usr/local/bin/node Yarn: 1.22.15 - /usr/local/bin/yarn npm: 8.1.2 - /usr/local/bin/npm Watchman: 2022.03.21.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 Android SDK: API Levels: 22, 23, 24, 26, 27, 28, 29, 30, 31 Build Tools: 25.0.0, 26.0.1, 26.0.2, 27.0.3, 28.0.3, 29.0.2, 30.0.1, 30.0.2, 30.0.3, 31.0.0 System Images: a...s_playstore | Google Play Intel x86 Atom Sys..., a...google_apis | Google APIs Intel x86 Atom Sys... Android NDK: 17.2.4988734 IDEs: Android Studio: 2021.2 AI-212.5712.43.2112.8609683 Xcode: 13.4/13F17a - /usr/bin/xcodebuild Languages: Java: 1.8.0_241 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.0.0 => 18.0.0 react-native: 0.69.1 => 0.69.1 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
run build
Snack, code example, screenshot, or link to a repository
./node_modules/hermes-engine/osx-bin/hermesc
Hermes JavaScript compiler. Hermes release version: 0.11.0 HBC bytecode version: 84
./node_modules/react-native/sdks/hermesc/osx-bin/hermesc -version
Hermes JavaScript compiler. Hermes release version: 0.11.0 HBC bytecode version: 85
@chuckwu0 I had the same problem. The cause of my issue was that I had overwritten the project.ext.react.hermesCommand
in android/app/build.gradle
because I'm using a monorepo. You have to change that property from 'node_modules/hermes-engine/%OS-BIN%/hermesc'
to 'node_modules/react-native/sdks/hermesc/%OS-BIN%/hermesc'
@chuckwu0 I had the same problem. The cause of my issue was that I had overwritten the
project.ext.react.hermesCommand
inandroid/app/build.gradle
because I'm using a monorepo. You have to change that property from'node_modules/hermes-engine/%OS-BIN%/hermesc'
to'node_modules/react-native/sdks/hermesc/%OS-BIN%/hermesc'
This was my exact scenario. Thank you for this!
I copied hermesc under ./node_modules/hermes-engine/osx-bin/hermesc into ./node_modules/react-native/sdks/hermesc/osx-bin/hermesc -version.
Now both versions are 85. I will update if it's a solution
com.facebook.jni.CppException: Compiling JS failed: Wrong bytecode version. Expected 85 but got 84 Buffer size 3419342 starts with: c61fbc03c103191f540000005641aaed and has protection mode(s): r--p
Going to close this as several answers got already provided.
The issue Wrong bytecode version. Expected 85 but got 84
is happening if you're using a older version of hermesc
which is not compatible with the runtime.
You should be using the hermesc
which is placed inside:
node_modules/react-native/sdks/hermesc
and not others. If you're on Android/NewArch you'll be building hermesc
from source. More on this here: https://reactnative.dev/architecture/bundled-hermes
I copied hermesc under ./node_modules/hermes-engine/osx-bin/hermesc
@atlantismgmt This won't work in the future. That version of hermesc
is stale. That package got removed in 0.70.
The cause of my issue was that I had overwritten the project.ext.react.hermesCommand
This is most likely the issue that most users are facing as you might have provided a custom hermesCommand
. By default the setup is smart is searching where the hermesc
lives.
com.facebook.jni.CppException: Compiling JS failed: Wrong bytecode version. Expected 85 but got 84 Buffer size 3419342 starts with: c61fbc03c103191f540000005641aaed and has protection mode(s): r--p
Going to close this as several answers got already provided.
The issue
Wrong bytecode version. Expected 85 but got 84
is happening if you're using a older version ofhermesc
which is not compatible with the runtime.You should be using the
hermesc
which is placed inside:node_modules/react-native/sdks/hermesc
and not others. If you're on Android/NewArch you'll be building
hermesc
from source. More on this here: https://reactnative.dev/architecture/bundled-hermesI copied hermesc under ./node_modules/hermes-engine/osx-bin/hermesc
@atlantismgmt This won't work in the future. That version of
hermesc
is stale. That package got removed in 0.70.The cause of my issue was that I had overwritten the project.ext.react.hermesCommand
This is most likely the issue that most users are facing as you might have provided a custom
hermesCommand
. By default the setup is smart is searching where thehermesc
lives.
@cortinico @TheWirv So I overrode the hermes command as per the expo modules migration documentation:
hermesCommand: new File(["node", "--print", "require.resolve('hermes-engine/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + "/%OS-BIN%/hermesc",
https://github.com/expo/fyi/blob/main/expo-modules-migration.md So should I just remove that line?
So should I just remove that line?
yes correct 👍
I am getting this while upgrading to RN - 68.5 Is there any default hermes version RN comes with ?
Compiling JS failed: Wrong bytecode
version. Expected 84 but got 62
Buffer size 4722736 starts with:
c61fbc03c103191f3e0000006febOce7 and has
protection mode(s): rw-p
In my case when I update my app with code push and the user downloads the update become crash. I updated appcenter to the latest and it's working.
for a fixed, start this version https://github.com/microsoft/appcenter-cli/releases/tag/v2.11.0
I was stuck with this issue for a week until I realized that my project version was different from what was distributed with CodePush 😅.
For a clearer explanation, I had upgraded the React Native (RN) version of my project, which also involved some native changes. Let's say app version after upgrade is 2.0. However, when I ran the app, it crashed after receiving the CodePush update and restarting the app. It was then that I realized the app version from CodePush was still 1.0 😂. So, naturally, the error occurred due to this discrepancy.
Description
com.facebook.jni.CppException: Compiling JS failed: Wrong bytecode version. Expected 85 but got 84 Buffer size 3419342 starts with: c61fbc03c103191f540000005641aaed and has protection mode(s): r--p at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27) at android.os.Looper.loop(Looper.java:236) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
Version
0.69.1
Output of
npx react-native info
System: OS: macOS 12.4 CPU: (8) x64 Apple M1 Memory: 35.58 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.13.2 - /usr/local/bin/node Yarn: 1.22.15 - /usr/local/bin/yarn npm: 8.1.2 - /usr/local/bin/npm Watchman: 2022.03.21.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 Android SDK: API Levels: 22, 23, 24, 26, 27, 28, 29, 30, 31 Build Tools: 25.0.0, 26.0.1, 26.0.2, 27.0.3, 28.0.3, 29.0.2, 30.0.1, 30.0.2, 30.0.3, 31.0.0 System Images: a...s_playstore | Google Play Intel x86 Atom Sys..., a...google_apis | Google APIs Intel x86 Atom Sys... Android NDK: 17.2.4988734 IDEs: Android Studio: 2021.2 AI-212.5712.43.2112.8609683 Xcode: 13.4/13F17a - /usr/bin/xcodebuild Languages: Java: 1.8.0_241 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.0.0 => 18.0.0 react-native: 0.69.1 => 0.69.1 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
run build
Snack, code example, screenshot, or link to a repository