wix / react-native-navigation

A complete native navigation solution for React Native
https://wix.github.io/react-native-navigation/
MIT License
13.05k stars 2.67k forks source link

Error compiling library version 7.40.1 #7911

Closed edoardocarpentiero closed 2 months ago

edoardocarpentiero commented 2 months ago

What happened?

Hi everyone, I'm having this problem while compiling the react-native-navigation library version 7.40.1.

file:///C:/Users/<>/Desktop/Progetto%20React/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/utils/ReactViewGroup.kt:7:59 Unresolved reference: fullBorderRadius e: file:///C:/Users/<>/Desktop/Progetto%20React/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/LayoutDirectionApplier.kt:11:45 Smart cast to 'ReactContext' is impossible, because 'instanceManager.currentReactContext' is a property that has open or custom getter e: file:///C:/Users/<>/Desktop/Progetto%20React/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/LayoutDirectionApplier.kt:12:45 Smart cast to 'ReactContext' is impossible, because 'instanceManager.currentReactContext' is a property that has open or custom getter e: file:///C:/Users/<>/Desktop/Progetto%20React/node_modules/react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt:53:56 Type mismatch: inferred type is MotionEvent? but MotionEvent was expected e: file:///C:/Users/<>/Desktop/Progetto%20React/node_modules/react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt:53:70 Type mismatch: inferred type is EventDispatcher? but EventDispatcher was expected e: file:///C:/Users/<>/Desktop/Progetto%20React/node_modules/react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt:56:56 Type mismatch: inferred type is MotionEvent? but MotionEvent was expected e: file:///C:/Users/<>/Desktop/Progetto%20React/node_modules/react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt:56:70 Type mismatch: inferred type is EventDispatcher? but EventDispatcher was expected e: file:///C:/Users/<>/Desktop/Progetto%20React/node_modules/react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt:60:68 Type mismatch: inferred type is EventDispatcher? but EventDispatcher was expected e: file:///C:/Users/<>/Desktop/Progetto%20React/node_modules/react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt:80:52 Type mismatch: inferred type is EventDispatcher? but EventDispatcher was expected e: file:///C:/Users/<>/Desktop/Progetto%20React/node_modules/react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt:88:52 Type mismatch: inferred type is EventDispatcher? but EventDispatcher was expected FAILURE: Build failed with an exception. What went wrong: Execution failed for task ':react-native-navigation:compileReactNative71DebugKotlin'. > A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction > Compilation error. See log for more details Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. BUILD FAILED in 24s.

The configuration used is the following:

From what I could see from the error logs, there are some parameters that are not set into some method into library, causing errors in the Android app build. I tried changing the kotlin version but nothing to do, it's always been this problem.

Thank you in advance for your support

What was the expected behaviour?

No response

Was it tested on latest react-native-navigation?

Help us reproduce this issue!

No response

In what environment did this happen?

No response

ertugruldogan commented 2 months ago

https://github.com/wix/react-native-navigation/issues/7905 A similar topic already exists.

edoardocarpentiero commented 2 months ago

the fix presented by siddarthkay solves the problem