react-native-gesture-handler: Task :react-native-gesture-handler:compileDebugKotlin FAILED RN 0.69.3 with new arch
Description
When I build my app its failed with this errors:
Task :react-native-gesture-handler:compileDebugKotlin FAILED
e: /Users/myname/Desktop/my-app/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt: (28, 40): Unresolved reference: RNGestureHandlerButtonManagerDelegate
e: /Users/myname/Desktop/my-app/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt: (29, 40): Unresolved reference: RNGestureHandlerButtonManagerInterface
e: /Users/myname/Desktop/my-app/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt: (34, 80): Unresolved reference: RNGestureHandlerButtonManagerInterface
e: /Users/myname/Desktop/my-app/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt: (38, 19): Unresolved reference: RNGestureHandlerButtonManagerDelegate
e: /Users/myname/Desktop/my-app/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt: (47, 3): 'setForeground' overrides nothing
e: /Users/myname/Desktop/my-app/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt: (52, 3): 'setBorderless' overrides nothing
e: /Users/myname/Desktop/my-app/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt: (57, 3): 'setEnabled' overrides nothing
e: /Users/myname/Desktop/my-app/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt: (67, 3): 'setRippleColor' overrides nothing
e: /Users/myname/Desktop/my-app/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt: (72, 3): 'setRippleRadius' overrides nothing
e: /Users/myname/Desktop/my-app/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt: (77, 3): 'setExclusive' overrides nothing
e: /Users/myname/Desktop/my-app/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt: (82, 3): 'setTouchSoundDisabled' overrides nothing
e: /Users/myname/Desktop/my-app/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootViewManager.kt: (7, 40): Unresolved reference: RNGestureHandlerRootViewManagerDelegate
e: /Users/myname/Desktop/my-app/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootViewManager.kt: (8, 40): Unresolved reference: RNGestureHandlerRootViewManagerInterface
e: /Users/myname/Desktop/my-app/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootViewManager.kt: (17, 3): Unresolved reference: RNGestureHandlerRootViewManagerInterface
e: /Users/myname/Desktop/my-app/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootViewManager.kt: (21, 17): Unresolved reference: RNGestureHandlerRootViewManagerDelegate
w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions
It works fine with new arch disabled, but failed when I enable it.
Steps to reproduce
- Enable new arch
- Clean the project
- Build the app (Android)
Snack or a link to a repository
Not needed
Gesture Handler version
2.5.0
React Native version
0.69.3
Platforms
Android
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Fabric (New Architecture)
Build type
Debug mode
Device
No response
Device model
No response
Acknowledgements
Yes
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 27
- Comments: 57 (7 by maintainers)
Hey all šš¼ Apparently, that was related to my SDK & Tools versions. Iāve upgraded from 32 to 33 and all was sorted.
yarn add react-native-reanimated@next
solved the building problemSame problem with android and enabled new architecture kotlin_version: 1.6.10 react-native-gesture-handler: 2.8.0 react-native: 0.70.5
So I solved it by
kotlinVersion = "1.4.10" to kotlinVersion = "1.5.20" in my android/build.gradle
"react-native-gesture-handler": "^2.8.0"
,After upgrade to new RN and turn on new arch, I got the same issue. I need to clean up my
settings.gradle
,build.gradle
,app/build.gradle
following current version setup from RN repository to build succesfully.Iām using:
and somehow i need to upgrade:
I remove manual linking on
settings.gradle
since they already linked frombuild/generated/rncli/../PackageList.java
I also add
kotlinVersion
tobuild.gradle
and removeclasspath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
if any to avoid duplicate.For addition I found issue
Android.mk:Build command failed
and end up to fix other issue by settingorg.gradle.parallel=false
ongradle.properties
.After trying different ways, you can finally fix it by updating to expo sdk 47 and expo dev-client 2.0.1 and update react-native-gesture-handler to 2.8.0 version.
also install expo-build-properties and add the following properties:
ācompileSdkVersionā: 33, ātargetSdkVersionā: 33, ābuildToolsVersionā: ā30.0.2ā, āKotlinVersionā: ā1.7.10ā
Good luck.
It worked for me to
with me it worked.
I upgraded the kotlin version,fixed itć Chinese translation into English, I hope you can understand
Hi guys.
React native : 0.71.8
For me what worked was:
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions'
ext { kotlinVersion = '1.6.20' compileSdkVersion = 33 }
dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlinVersion" }
include ':react-native-gesture-handler' project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
this solved my problem in
android/build.gradle
@j-piasecki this didnāt work
// android/build.gradle - updating the version change worked for me
buildscript { ext { buildToolsVersion = ā33.0.0ā minSdkVersion = 21 compileSdkVersion = 33 targetSdkVersion = 33 kotlinVersion = ā1.6.10ā }
}
// android/build.gradle - updating the version change worked for me
This worked for me. Thank you.
@alejodelosrios 's solution worked for me!
I cannot say whether your app will work after removing
react-native-reanimated
but if youāre using the new architecture then you should be using the most recent release of Reanimated 3.The problem is in react-native-gesture-handler library.
āreact-nativeā: ā0.70.5ā, āreact-native-reanimatedā: ā^3.0.0-rc.4ā, āreact-native-gesture-handlerā: ā^2.8.0ā,
@j-piasecki Ok Iāve found that after adding reanimated 2.12 to the sample RN-0.70.5 project with gesture-handler 2.8.0, I got failing build. So should reanimated@next be used instead of stable 2.12?
Yeah, the same issue. react-native v0.69.5 react-native-gesture-handler v2.7.1