react-native-reanimated: [V3] Exception in HostFunction: java.lang.NoSuchMethodError: no non-static method

Description

Hi there, just a clean build to test v3, my code:

import Animated from 'react-native-reanimated';

const App = () => {
  return (
    <Animated.View style={{width: 200, height: 200, backgroundColor: 'red'}} />
  );
};

export default App;

got this error: Exception in HostFunction: java.lang.NoSuchMethodError: no non-static method "Lcom/swmansion/reanimated/NativeProxy;.registerEventHandler(Lcom/swmansion/reanimated/nativeProxy/EventHandler;)V", js engine: hermes

package.json:

 "dependencies": {
    "@shopify/react-native-skia": "^0.1.175",
    "react": "18.2.0",
    "react-native": "0.71.3",
    "react-native-gesture-handler": "^2.9.0",
    "react-native-reanimated": "^3.0.0",
    "react-native-safe-area-context": "^4.5.0",
    "react-native-screens": "^3.20.0"
  },

Steps to reproduce

just did a clean build with that packages.

Snack or a link to a repository

simple code, no need to repository

Reanimated version

3.0.0

React Native version

0.71.3

Platforms

Android

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

Debug mode

Device

Android emulator

Device model

No response

Acknowledgements

Yes

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 22
  • Comments: 45 (9 by maintainers)

Commits related to this issue

Most upvoted comments

Just downgrade your react-native-reanimated from v3 to v2. It will start working 🚀

I don’t known, but this patch helps me with android 8 https://gist.github.com/balmasich/e13ae0b12d3b4ab166a6143204b87dae

@efstathiosntonas could you check please?

Reanimated 2.15.0 contains all those fixes, and Reanimated 3.1.0 will be released soon.

Also getting this error on Android 8.

No issue on Android 13

✅cleared cache. ✅also configured babel correctly.

Hey! 👋

The issue doesn’t seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

@mysport12 same here, affecting ~50 users that use old devices., rean 3.0.2 and rn 0.71.4

I’m also facing the same issue React native version 69.5 Reanimated version 3.0.0 App crashed when using the react native drawer menuIMG_20230302_232400.jpg

Was there any work-around on this issue?

Also facing the same issue here

Hi, how does the release process work? The repo made a new patch 3.0.2 “just” to fix the typings but is not publishing a new patch once they merged a Pr that avoid a crash on Android 7/8 that prevent most people to use v3.

How do you decide when to update/patch or not or is there a release plan somewhere?

@dziekonskik you just have to open the file located at this given path and change the access modifiers from private to public as shown in the patch node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/nativeProxy/NativeProxyCommon.java

I tested the latest version 3.1.0 and can confirm that it resolves the error

same problem here, waiting for a official fixed release

@efstathiosntonas Reanimated nightly builds are published as GitHub Actions artifacts. In order to use them in your app, you will need to:

  1. Download v3 nightly zip archive from https://github.com/software-mansion/react-native-reanimated/actions/workflows/build-nightly-npm-package.yml
  2. Unzip the archive from the command line with unzip react-native-reanimated-3.0.2.tgz
  3. Add a dependency with yarn add file:/path/to/the/react-native-reanimated-3.0.2.tgz

works great! thank you @hassancodess 😃

Same issue here: Error: Exception in HostFunction: java.lang.NoSuchMethodError: no non-static method "Lcom/swmansion/reanimated/NativeProxy;.registerEventHandler(Lcom/swmansion/reanimated/nativeProxy/EventHandler;)V", js engine: hermes

Running "react-native-reanimated": "^3.0.2", with "react-native": "0.71.4",