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

Android 12.6.1: Error: Getting '$$typeof' from binding before it was injected, js engine: hermes #6522

Closed
Overtorment opened this issue Feb 29, 2024 · 10 comments · Fixed by #6524

Comments

@Overtorment
Copy link

How frequently does the bug occur?

Always

Description

After updating from 12.6.0 to 12.6.1 got this very weird

Error: Getting '$$typeof' from binding before it was injected, js engine: hermes

Cant even google it. Also not sure if its realm to blame or some caching issues (did reasonable attempts to purge all caches)

Stacktrace & log output

No response

Can you reproduce the bug?

Always

Reproduction Steps

No response

Version

12.6.1

What services are you using?

Local Database only

Are you using encryption?

Yes

Platform OS and version(s)

Android

Build environment

Which debugger for React Native: ..

Cocoapods version

No response

Copy link

sync-by-unito bot commented Feb 29, 2024

➤ PM Bot commented:

Jira ticket: RJS-2746

@kraenhansen
Copy link
Member

kraenhansen commented Mar 1, 2024

Thank you for creating the issue. This is most likely related to Realm: We recently changed the way we initialise our binding to the Realm Core database and this error is thrown when this binding is accessed before it gets injected.

To help us debug this, we'd love to know more about your setup.

  • Would you be able to share your babel and metro configurations?
  • Are you using Expo?
  • Are you able to share more of the stack when this error is thrown?

@kraenhansen kraenhansen self-assigned this Mar 1, 2024
@sync-by-unito sync-by-unito bot added the Waiting-For-Reporter Waiting for more information from the reporter before we can proceed label Mar 1, 2024
@lemessdavi-soeltech
Copy link

lemessdavi-soeltech commented Mar 1, 2024

Im with the same issue, im using expo but bare-workflow and the error is thrown as soon as i open the app. Here are my babel and metro configs:

metro:
const { getDefaultConfig } = require('expo/metro-config'); module.exports = getDefaultConfig(__dirname);

babel:
module.exports = function(api) { api.cache(true); return { presets: ['babel-preset-expo'], plugins: ['react-native-reanimated/plugin'], }; };
After this error im also getting this error:

Invariant Violation: "main" has not been registered. This can happen if:

  • Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
  • A module failed to load due to an error and AppRegistry.registerComponent wasn't called., js engine: hermes

@devmuvi
Copy link

devmuvi commented Mar 1, 2024

Hi! having the same issue. Similar configuration with the difference that in the metro config we have:

const { getDefaultConfig } = require('expo/metro-config');

const config = getDefaultConfig(__dirname);

config.resolver.assetExts.push(
  // Adds support for `.db` files for SQLite databases
  'db'
);

module.exports = config;

@lemessdavi
Copy link

Hey, after some investigation the problem for me was an npm upgrade that changed A LOT of dependencies versions at my package-lock.

I simply reverted the commit and npm installed again, now its working as it should.

The file is 18000 lines long so I will not be pasting it here but if yall need something also i will do what I can.

@Overtorment
Copy link
Author

Our configuration can be found here (its FOSS): https://github.com/BlueWallet/BlueWallet

we reverted to 12.6.0
My colleague reported that he also experiensed somethign weird on iOS with 12.6.1

Interesting that our android e2e passed on CI - I suppose this is because this error is not causing a crash, just a red screen, which can be closed, and on production build its not displayed at all

@github-actions github-actions bot added Needs-Attention Reporter has responded. Review comment. and removed Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Mar 1, 2024
@kraenhansen
Copy link
Member

kraenhansen commented Mar 1, 2024

@Overtorment I tried cloning your BlueWallet repo (on the commit before downgrading Realm) but I can't get it to build on Android:

This is what I get when I open the project in Android Studio:

Null extracted folder for artifact: ResolvedArtifact(componentIdentifier=com.facebook.react:hermes-android:0.72.10, variant=com.facebook.react:hermes-android:0.72.10 variant debugVariantDefaultApiPublication, variantName=null, artifactFile=/Users/kraen.hansen/.gradle/caches/modules-2/files-2.1/com.facebook.react/hermes-android/0.72.10/39749c188b17b3722b70d1d5014ad0e64e81c26d/hermes-android-0.72.10-debug.aar, isTestFixturesArtifact=false, extractedFolder=null, publishedLintJar=null, dependencyType=ANDROID, isWrappedModule=false, buildMapping={current_build=/Users/kraen.hansen/Projects/BlueWallet/android, gradle-plugin=/Users/kraen.hansen/Projects/BlueWallet/node_modules/@react-native/gradle-plugin})

Simply running npx react-native run-android --verbose yields:

BUILD SUCCESSFUL in 17s
741 actionable tasks: 20 executed, 721 up-to-date
info Connecting to the development server...
debug Running command "/Users/kraen.hansen/Library/Android/sdk/platform-tools/adb -s emulator-5554 reverse tcp:8081 tcp:8081"
info Starting the app on "emulator-5554"...
debug Running command "/Users/kraen.hansen/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell am start -n io.bluewallet.bluewallet/io.bluewallet.bluewallet.MainActivity -a android.intent.action.MAIN -c android.intent.category.LAUNCHER"
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=io.bluewallet.bluewallet/.MainActivity }
Error type 3
Error: Activity class {io.bluewallet.bluewallet/io.bluewallet.bluewallet.MainActivity} does not exist.

I then tried iOS but hit BlueWallet/rn-ldk#47.

I also tried an Expo app, but without success and none of our test apps display this behaviour either 🤔

I do believe to have a fix ready for this particular case (I hope to be able to merge and release this early next week), but I would love to be able to reproduce this issue to understand why it happens and verify that it's actually solved for your particular setup.

@kraenhansen
Copy link
Member

kraenhansen commented Mar 4, 2024

We just released v12.6.2 with a fix for this - please help us verify that this solves the issue.

And thanks again for bringing it to our attention! 💙

@lemessdavi
Copy link

It seems alright for me now, i updated again and its working!

@Overtorment
Copy link
Author

@kraenhansen just fyi, your build said its successfull, it just could notlaunch the app on the emulator. just switchto emulator and tap the icon to run the app.

i will testthis fix, thanks

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.