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

Error: Exception in HostFunction: expected 1 arguments, got 0 #429

Closed
edapess opened this issue Apr 30, 2024 · 17 comments · Fixed by #410
Closed

Error: Exception in HostFunction: expected 1 arguments, got 0 #429

edapess opened this issue Apr 30, 2024 · 17 comments · Fixed by #410
Assignees
Labels
question You wanted to clarify something about the usage of the library or have a question about something

Comments

@edapess
Copy link

edapess commented Apr 30, 2024

Describe the bug
App crashes after start

To Reproduce
Update react native to 0.74.0

Screenshots
Screenshot_1714466258

Screenshot 2024-04-30 at 12 38 47

Smartphone (please complete the following information):

  • Desktop OS: Mac OS 14.4.1
  • Device: Pixel 8
  • OS: Android
  • RN version: 0.74.0
  • JS engine: Hermes
  • Library version: ^1.11.7
@edapess
Copy link
Author

edapess commented Apr 30, 2024

@kirillzyusko is there any eta for react native 0.74 ?

@kirillzyusko
Copy link
Owner

Hello @edapess

I was working in this branch for support 0.74 - https://github.com/kirillzyusko/react-native-keyboard-controller/pull/410/files

And I managed to run both apps (paper/fabric) without significant code modifications 🤷‍♂️ Can you try to use the version from this branch and see if it fixes the problem?

@edapess
Copy link
Author

edapess commented Apr 30, 2024

@kirillzyusko you mean react-native : "0.74.0-rc.6" ?

@kirillzyusko
Copy link
Owner

@edapess I meant to try to use chore/react-native-0.74 branch and install react-native-keyboard-controller from github (instead of npm).

@edapess
Copy link
Author

edapess commented Apr 30, 2024

@kirillzyusko I tried but it's not working, I think the issue can be related to reanimated version that we have to use in our app.

"react-native-reanimated": "^3.9.0",

Any Idea?

Also I found this PR #410

@kirillzyusko
Copy link
Owner

Yes @edapess

Can you try to use a version from the PR you sent? In this PR I'm using REA 3.9.0 so we both should use the same version 😊

@edapess
Copy link
Author

edapess commented Apr 30, 2024

@kirillzyusko I tried again, nothing changed, so the error comes from

Screenshot 2024-04-30 at 19 09 23 Screenshot 2024-04-30 at 19 09 23

@kirillzyusko
Copy link
Owner

Interesting 🤔 What is the version of REA in react-native-keyboard-controller/node_modules/react-native-reanimated?

@edapess
Copy link
Author

edapess commented Apr 30, 2024

it's 3.9.0

I found another thing, here is comment

her is issue

I had build issue with new React native version, after resolving it with using various versions, so as the comment mention I had conflicts in gorhom bottom sheet and keyboard controller (

@kirillzyusko
Copy link
Owner

@edapess it's weird 🤔 Why everything works in my PR? I'm also using bottom-sheet and safe-area-context in my example app.

@edapess
Copy link
Author

edapess commented Apr 30, 2024

@kirillzyusko yeeeah, it's weird :////, there is many reports

kirillzyusko added a commit that referenced this issue Apr 30, 2024
## 📜 Description

Updated `react-native` to `0.74` (wich has bridgeless mode enabled by
default in new arch).

## 💡 Motivation and Context

We need to support bridgeless mode.

Main changes to make fabric working were:
- change a context from which we emit an event (event emitter, not
dispatcher);
- remove checks for `_jsThread` on iOS (since it's bridgeless mode ->
these variable will be always `false`);

Also in this PR I had to remove flipper integration to speed up delivery
of this PR. Later on I'll probably add this integration back.

Closes
#429
#394

## 📢 Changelog

### JS

- bumed deps;

### iOS

- removed `_jsThread` check as in Fabric it'll be always `false`;

### Android

- change context for emitting events (now we need to use appContext);

## 🤔 How Has This Been Tested?

tested locally + on CI using both architectures.

## 📸 Screenshots (if appropriate):

Everything works as before 🙃 

## 📝 Checklist

- [x] CI successfully passed
- [x] I added new mocks and corresponding unit-tests if library API was
changed
@kirillzyusko kirillzyusko reopened this Apr 30, 2024
@kirillzyusko
Copy link
Owner

Well, I merged a pr with bridgeless support into main

Let's keep this PR open for now. If you want - you can clone this repository and compare project settings with your own project 👀 Maybe it'll help you somehow (but basically everything should be working).

@edapess
Copy link
Author

edapess commented Apr 30, 2024

@kirillzyusko Thanks anyway, will try, and will get back here if i find something, maybe it will help somebody else

@irekrog
Copy link

irekrog commented May 3, 2024

Sometimes I get exactly this error, but in React Native 0.73 and reanimated 3.8 and latest version keyboard-controller. It's hard to say what's wrong because the error appears randomly, only on Android.

@edapess
Copy link
Author

edapess commented May 3, 2024

Hey @irekrog @kirillzyusko I found the problem, in our app we had reanimated in resolutions section, so there was 3.6.1 version, which causes the problem, so check that case. Hope this will help you. So now my reanimated is 3.9.0 and react native is 0.74.0, everything works fine

I had to remove or bump version in resolutions, then delete node modules and install again.

@irekrog
Copy link

irekrog commented May 8, 2024

FYI in my case there was a problem with react-native-code-push :)

@kirillzyusko
Copy link
Owner

kirillzyusko commented May 8, 2024

@edapess @irekrog cool, glad we figured out and resolved your problems 😊 I'll close the issue then!

@kirillzyusko kirillzyusko added the question You wanted to clarify something about the usage of the library or have a question about something label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question You wanted to clarify something about the usage of the library or have a question about something
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants