react-native-gesture-handler icon indicating copy to clipboard operation
react-native-gesture-handler copied to clipboard

Kotlin Compilation Fails – Unresolved Supertype ViewManagerWithGeneratedInterface and Cannot access 'ViewManagerWithGeneratedInterface' which is a supertype of ...

Open vinaykumarIndia opened this issue 6 months ago • 9 comments

Description

React Native: 0.76.5 React: 18.3.1 react-native-reanimated: 3.16.7 react-native-screens: 4.6.0 Gradle: 8.10.2 Kotlin: 2.0.21. e: RNGestureHandlerButtonViewManager.kt: Cannot access 'ViewManagerWithGeneratedInterface' which is a supertype of 'RNGestureHandlerButtonViewManager'. Check your module classpath for missing or conflicting dependencies.

Steps to reproduce

Try to build the Android project using npm run android. Compilation fails with Kotlin errors.

A link to a Gist, an Expo Snack or a link to a repository based on this template that reproduces the bug.

https://1drv.ms/i/c/ba34a1b67a6d11bb/EWDlcVaAayxHhxD15VpNqm0BLOv-T82jaRwpHbpm42oIXA?e=PeQdhB

Gesture Handler version

2.23.1

React Native version

0.76.5

Platforms

MacOS

JavaScript runtime

None

Workflow

React Native (without Expo)

Architecture

None

Build type

Debug mode

Device

Android emulator

Device model

No response

Acknowledgements

Yes

vinaykumarIndia avatar Jun 17 '25 06:06 vinaykumarIndia

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?

github-actions[bot] avatar Jun 17 '25 06:06 github-actions[bot]

Hi @vinaykumarIndia! Based on description I assume that your target platform is android. Beside that, is something wrong with macOS? (I'm asking since you've chose this platform).

Anyway, both, RN 0.76 and Gesture Handler 2.23.1 are quite old, does this also happen in newer versions?

m-bert avatar Jun 17 '25 06:06 m-bert

same here, only for android, suddenly the android build stopped working RN: 0.76.6 GestureHandler: 2.26.0

if I use GestureHandler: 2.25.0 it's working

larkonesvk avatar Jun 17 '25 07:06 larkonesvk

@larkonesvk each Gesture Handler version is guaranteed to support 3 latest minor releases of RN, so for 2.26 last supported version is RN 0.78. For older versions it might work, but we do not test that far behind.

m-bert avatar Jun 17 '25 07:06 m-bert

same here RN: 0.75.4 GestureHandler: 2.25.0 not working

camboYY avatar Jun 23 '25 06:06 camboYY

@camboYY 2.25.0 is meant to be used with at least 0.76.

@vinaykumarIndia have you been able to try updated versions?

m-bert avatar Jun 23 '25 06:06 m-bert

@m-bert Can you pls have a look at this too same issue working in debug mode , but failing during release build job React native 0.74.7 -old architecture React native guesture handler tried versions from 2.20 to latest same issue with all platform Android(no issues with ios build)

Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
class com.facebook.react.viewmanagers.RNGestureHandlerButtonManagerInterface, unresolved supertypes: ViewManagerWithGeneratedInterface
class com.facebook.react.viewmanagers.RNGestureHandlerRootViewManagerInterface, unresolved supertypes: ViewManagerWithGeneratedInterface

vamsig7 avatar Jun 24 '25 14:06 vamsig7

@m-bert Can you pls have a look at this too same issue working in debug mode , but failing during release build job

I've just created RN app on 0.74.7 with Gesture Handler 2.23.1 - last version supporting 0.74. It works as expected on both debug and release.

m-bert avatar Jun 24 '25 16:06 m-bert

I am currently on a MacOs with React-native version 0.76.8 and just tried building for android with version 2.25.0 and I also am getting the same build error:

node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootViewManager.kt:25:79 Cannot access 'ViewManagerWithGeneratedInterface' which is a supertype of 'com.swmansion.gesturehandler.react.RNGestureHandlerRootViewManager'. Check your module classpath for missing or conflicting dependencies FAILURE: Build failed.

I am trying to just test out different versions to see what clicks but I started with a older version of gesture handler and worked my way up to here. I will comment here if i find a way through it.

CascadiaTech avatar Jun 24 '25 16:06 CascadiaTech

Hi @CascadiaTech!

I am currently on a MacOs with React-native version 0.76.8 and just tried building for android with version 2.25.0 and I also am getting the same build error:

Can you show me your package.json?

m-bert avatar Jun 25 '25 07:06 m-bert

Since we cannot reproduce this on our end, we have to take some action. I'm closing this issue as there is no reproduction that we can look at.

If this issue still persists, you can open new one. In that case:

  1. Remember to attach minimal, reproducible example.
  2. Use one of the following Gesture Handler versions:
    • 2.26.0 (with react-native >= 0.78.0)
    • 2.25.0 (with react-native between 0.79.x and 0.76.0)

[!CAUTION] Issues without working reproduction, as well as using older Gesture Handler versions (< 2.25.0), will be closed!

m-bert avatar Jun 25 '25 10:06 m-bert

Cannot access 'ViewManagerWithGeneratedInterface' in RNGestureHandlerRootViewManager with RN 0.74.5 and react-native-gesture-handler 2.23.1

I’m encountering the following error when building my React Native app:

Cannot access 'ViewManagerWithGeneratedInterface' which is a supertype of 'com.swmansion.gesturehandler.react.RNGestureHandlerRootViewManager'. Check your module classpath for missing or conflicting dependencies

React Native version: 0.74.5 Android gradle plugin: 8.6.0 Gradle: 8.7 react-native-gesture-handler version: 2.23.1

It seems like there may be an incompatibility between the latest react-native-gesture-handler and the ViewManagerWithGeneratedInterface used by React Native 0.74.x. Could you please help confirm if react-native-gesture-handler 2.23.1 is fully compatible with RN 0.74.5, or provide guidance on supported versions?

himanshu-brainvire-21 avatar Jul 02 '25 05:07 himanshu-brainvire-21

my react-native version is 0.75.1. Although I tried to fix the issue multiple times (using several versions), I'm still getting this error:

Image how can I fix this issue?

jeff-dev94 avatar Jul 07 '25 06:07 jeff-dev94

I'm having the same problem. Using react-native 0.77.2. I had to install this to use React Native Reanimated Carousel, and while it works flawlessly in iOS it crashes while building in Android

UnderTheMoonspell avatar Jul 07 '25 17:07 UnderTheMoonspell

We've decided to lock conversation on this issue since no valuable information were provided.

As per my last comment, if this issue still persists, you can open new one. In that case:

  1. Remember to attach minimal, reproducible example.
  2. Use one of the following Gesture Handler versions:
    • 2.26.0 (with react-native >= 0.78.0)
    • 2.25.0 (with react-native between 0.79.x and 0.76.0)

[!CAUTION] Issues without working reproduction, as well as using older Gesture Handler versions (< 2.25.0) or React Native (< 0.76.0), will be closed!

m-bert avatar Jul 08 '25 06:07 m-bert