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

Crash when calling a @ReactMethod with 3 Callback parameters #25784

Closed
arthakdoo opened this issue Jul 23, 2019 · 9 comments
Closed

Crash when calling a @ReactMethod with 3 Callback parameters #25784

arthakdoo opened this issue Jul 23, 2019 · 9 comments
Labels
Bug Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@arthakdoo
Copy link

arthakdoo commented Jul 23, 2019

I have a function with the following signature in Java:
@ReactMethod public void showPlacement(String placementName, Callback onError, Callback onShown, Callback onDismissed) { /* ... */ }

When I run it from within JavaScript, it causes a crash with the following message:

com.facebook.jni.CppException: JS Functions are not convertible to dynamic

When I delete the 3rd callback parameter (Callback onDismissed), the crash disappears and the breakpoint is hit inside the function, which can then run normally.

React Native version:
React Native Environment Info:
System:
OS: macOS 10.14.5
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Memory: 446.24 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.10.0 - /usr/local/bin/node
Yarn: 1.17.0 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
IDEs:
Android Studio: 3.4 AI-183.6156.11.34.5522156
Xcode: 10.3/10G8 - /usr/bin/xcodebuild
npmPackages:
react: ^16.8.2 => 16.8.2
react-native: 0.59.9 => 0.59.9
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-create-bridge: 2.0.1
react-native-create-library: 3.1.2
react-native: 0.59.9

Steps To Reproduce

  1. See below the link to the react-native-tapjoy-indi package on GitLab. It is a fairly trivial wrapper around the Tapjoy SDK at an early stage, and you can see the function showPlacement.
  2. Add the library to any React Native project and run ReactNativeTapjoyIndo.showPlacement
  3. A crash happens before even entering the function

Describe what you expected to happen:
I expect to be able to run a function and hit a breakpoint in debug mode. All other functions of this module are runnable, except for this one with 3 callback params.

Snack, code example, screenshot, or link to a repository:

https://gitlab.com/coldevel/react-native-tapjoy-indi (commit 45a12f46eb78630c)

or install directly from:

https://www.npmjs.com/package/react-native-tapjoy-indi @ 1.0.13

@arthakdoo arthakdoo added the Bug label Jul 23, 2019
@react-native-bot
Copy link
Collaborator

It looks like you are using an older version of React Native. Please update to the latest release, v0.60 and verify if the issue still exists.

The "Resolution: Old Version" label will be removed automatically once you edit your original post with the results of running `react-native info` on a project using the latest release.

@react-native-bot react-native-bot added the Ran Commands One of our bots successfully processed a command. label Aug 7, 2019
@react-native-bot
Copy link
Collaborator

I am closing this issue because it does not appear to have been verified on the latest release, and there has been no followup in a while.

If you found this thread after encountering the same issue in the latest release, please feel free to create a new issue with up-to-date information by clicking here.

@nicol-ograve
Copy link

It happens even in the latest version (0.60.5)

@rodperottoni
Copy link

rodperottoni commented Sep 9, 2019

I'm getting a lot of these errors on RN 0.59.10. What's weird about this is the fact that this error is defined inside of a class in the Hermes project: JSIDynamic.cpp. As you may guess, I'm not using Hermes at all.
Getting around ~70 crashes per week on a >100k active users app.
Screen Shot 2019-09-09 at 2 04 11 pm

@saghul
Copy link
Contributor

saghul commented Oct 8, 2019

Same here, can we please get it reopened?

@arthakdoo
Copy link
Author

I open a ticket, provide all tech info and give an exact way how to reproduce it, and they kick me around saying I should try it on the new versions. For a responsible team which loves their project and wants to make it better it's 5 minutes to try it out with all given instructions.

@zidniryi
Copy link

Yes, same here again. LOL

@SamCosta1
Copy link

I'm also seeing this issue on version 0.63.0

@shukerullah
Copy link

Crashing on v0.62.0

@facebook facebook locked as resolved and limited conversation to collaborators Oct 6, 2021
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

8 participants