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

0.69.1 Runtime error Wrong bytecode version. Expected 85 but got 84 #34114

Closed
chuckwu0 opened this issue Jul 1, 2022 · 11 comments
Closed

0.69.1 Runtime error Wrong bytecode version. Expected 85 but got 84 #34114

chuckwu0 opened this issue Jul 1, 2022 · 11 comments
Labels
Resolution: Answered When the issue is resolved with a simple answer Tech: Hermes Hermes Engine: https://hermesengine.dev/

Comments

@chuckwu0
Copy link

chuckwu0 commented Jul 1, 2022

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

image

@chuckwu0 chuckwu0 added Needs: Triage 🔍 Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules) labels Jul 1, 2022
@chuckwu0
Copy link
Author

chuckwu0 commented Jul 1, 2022

and found another bug:
FlatList【onEndReached】 not work on Android at 0.69.1
which 0.68.x is work.

#34128

@chuckwu0
Copy link
Author

chuckwu0 commented Jul 1, 2022

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

image

I think the bug because the two dir hermesc version not the same

./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

@TheWirv
Copy link
Contributor

TheWirv commented Jul 6, 2022

@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'

@eliw00d
Copy link

eliw00d commented Jul 15, 2022

@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'

This was my exact scenario. Thank you for this!

@atlantismgmt
Copy link

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

@cortinico cortinico added Tech: Hermes Hermes Engine: https://hermesengine.dev/ and removed Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules) labels Aug 5, 2022
@cortinico
Copy link
Contributor

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.

@cortinico cortinico added Resolution: Answered When the issue is resolved with a simple answer and removed Needs: Triage 🔍 labels Aug 5, 2022
@KrisLau
Copy link

KrisLau commented Aug 24, 2022

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.

@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?

@cortinico
Copy link
Contributor

So should I just remove that line?

yes correct 👍

@Darsbir
Copy link

Darsbir commented Dec 9, 2022

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

@imamrobani
Copy link

imamrobani commented Mar 1, 2023

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

rajarsheechatterjee pushed a commit to LNReader/lnreader that referenced this issue May 8, 2023
* remove AsyncStorage, disable hermes

* init

* update logic

* update libs for plugins

* move interface to types

* refactor, add language type

* small refactor of languages

* getPlugin

* update alias

* collect plugin on launch

* update interface Plugin

* move lang to PluginItem

* implement install plugins

* fix plugins reference

* fix fetching logic

* fix empty list

* refactor Browscreen

* implement searchNovels

* refactor plugin reducer

* try to remove old sources

* try to refactor

* tabview with theme, remove rn-fetch-blob

* update lib for plugin, temp fix for browse

* try to replace source by plugin in db

* many updates

* update db

* fix queries error

* update db

* update db

* update History table

* update db types

* format table name

* rename service

* rename field

* refactor interfaces

* update constrait

* update novel queries

* update constrait

* update novel and category queries

* more flexible category

* update library queris

* create category trigger, add constraints

* sync variables name with js rule :(

* setup database 90%

* updates queries

* queries to add novel to lib

* remove delete updates => delete download

* minor

* app work 20%

* query default one time

* createdb first

* remove 90% sources

* fix library queries

* temporary fix

* remove all source

* remove old languages constant

* update trigger

* update types

* refactor types, update trigger, refactor queries

* at least can go to novel screen

* update novel redux

* can go to novel screen

* remove generator

* change sourceId to pluginId

* can read chapter :(

* minor fix

* can use history screen

* unique key in historyscreen

* remove never use hook

* at least can use reader

* minor

* fix download queries

* fix history and chapterDrawer doenst need setNovel

* fix last read

* update click heart to follow novel

* insertNovel

* long press novels in library,

* change default category by move up

* update edit category, fix foreign constrait

* loading before get novel done

* fix categories were added.
Dont know why trigger didnt work.
So I decide to use normal queries

* fix errors when edit infos

* shorter init plugin

* fix stats screen

* minor fix for seekbar

* set re-request, fix download chapter

* hard fix:), maybe refactor it later

* must use sum to count :D

* update query

* fix migrate screen

* minor fix

* fix migrate screen and global search display

* minor

* quick fix for update screen

* update plugin props

* lol :D

* Backup work now.
But need to install plugins

* restore error backup

* If get novel without chapters. Fetch it again

* if all error novels are restored, remove error file

* minor fix

* remove never used packages.

* Complete plugin feature. Bump to RN 0.69.
I will write a  changelog soon

* fetchFile for app side

* Fix: transparent bottem sheet, undefined index.
hideNavigationBar causes transparent bottem sheet (still opening but invisible.
Hope to find an actual fix later

* newUpdateDialog without markdown

* fix: Browse plugins behaviors

* fix: reader screen crashs when plugin is not installed

* Minor fix: undefined variables when updating

* minor fix: fetchFile return base64

* only update newversion

* fix: buildReleas succesfully but app crashes when opening.
from: facebook/react-native#34114

* fix: webview send correct body height

* Refactor: remove HistoryTable.
remove PluginStatus

* Refactor: Migrate Update and History into Chapter.
- remove nerver used hook: useChapter

* fix: edit categories modal in novel screen

* minor: LL date format

* minor: remove html2text lib

* minor: migrate inlibrary novel

* Migrate novel and clean up

* small fix for migrate function

* Database Diagram

* optimise: O(1) to determine if lastread is read

* fix: position could be undefined

* refactor: change prop name. postion.position -> postion.offsetY

* fix filter

* fix: missing param in parseChapterNumber

* not a good fix, but it works xD

* fix: Text trunct almost title, should find a better fix later.

* enable feature: migrate from browse screen

* add data-plugin-id tag

* no `ghost` novel (which has no category)

* minor fix: detele all novel categories when removing novel form lib

* minor: deleteDownloadsSnackbar

* edit warning

* add chapter tag on preview

* add id for plugin, novel, chapter. smaller padding

* Use BottomSheetModal

* implement cookies bypass

* default language filter

* change default user agent

* shorter langue native name

* missing NOVEL_ERROR

* add filterInputs

* correct spelling :)

* add dayjs

* minor: remove console.log

* update site for pluginItem

* update icon,

* minor: remove unnecessary things
@AdlinMH
Copy link

AdlinMH commented Aug 2, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Answered When the issue is resolved with a simple answer Tech: Hermes Hermes Engine: https://hermesengine.dev/
Projects
None yet
Development

No branches or pull requests

9 participants