wix / react-native-navigation

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

A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction #7818

Open Harisene opened 8 months ago

Harisene commented 8 months ago

What happened?

I recently updated the RN version to 0.72.7. When I try to build the Android app I get the error as mentioned below.

What was the expected behaviour?

No response

Was it tested on latest react-native-navigation?

Help us reproduce this issue!

Here is the error message from the terminal

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-navigation:compileReactNative62DebugKotlin'.
> 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 2m

In what environment did this happen?

React Native Navigation version: 7.37.2 React Native version: 0.72.7 Has Fabric (React Native's new rendering system) enabled: (yes/no) no Node version: 18.11.0 Java version: 11 Kotlin version: 1.8.22 Gradle version: 8.0.1 Device model: Android version:

Osamasomy commented 3 months ago

same issue

"react-native": "0.74.1", "react-native-vision-camera": "^4.0.3",

* What went wrong:
Execution failed for task ':react-native-vision-camera:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
GalMarkelj commented 3 months ago

Same issue as @Osamasomy

JaRoMasterDev commented 3 months ago

+1

JaRoMasterDev commented 3 months ago

I was facing this issue in my own app:compileDebugKotlin task. After a while I figured that I had forgotten to call the ReactActivity constructor in my MainActivity.kt file after upgrading from java to kotlin.

class MainActivity : ReactActivity() {

Forgot the "()".

Maybe this helps someone in here

jaaywags commented 2 months ago

I was facing this issue too. Turned out I misspelled my app name in MainApplication.kt. I used the React Native Upgrade helper tool and must have copied that files contents and didn't update the app name.

This comment got me pointed in the right direction.

After that, I got some other errors similar to this MainActivity.kt:26:13 Expecting member declaration

Going to that file, I realized I had copied some logic form the previous version for RNBootSplash. I went to their website and got the up-to-date code.

Osamasomy commented 2 months ago

i solved this by adding few lines. see below attachment

image
sampriti026 commented 2 months ago

Hey I solved this issue by upgrading the react-native-screensb(because my error was

Task :react-native-screens:compileReleaseKotlin FAILED

, i think it was the conflict in the kotlin version mentioned in the build.gradle under node moduls -> react-native-screens-> android and the one i was using in the build.gradle of the root project. (that is android -> build.gradle).

TROOLLER commented 4 weeks ago

same issue here

Cathyccccc commented 3 weeks ago

I update file -- MainActivity.kt , like this :

`class MainActivity : NavigationActivity() {

// override fun getMainComponentName(): String = "AwesomeProject"

// override fun createReactActivityDelegate(): ReactActivityDelegate = // DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)

override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) } }`

may be you can find some errors in terminal tips, such as : e: override nothing getMainComponentName

you can follow the official document : https://wix.github.io/react-native-navigation/docs/installing#2-update-mainactivityjava

when i run npx rnn-link, the terminal show some errors : link_react-native-navigation_error i think i should update these files manually.

My version: "react-native-navigation": "^7.40.1", "react-native": "^0.73.9", android/build.gradle: ... ext { buildToolsVersion = "34.0.0" minSdkVersion = 23 compileSdkVersion = 34 targetSdkVersion = 34 ndkVersion = "26.1.10909125" kotlinVersion = "1.9.22" } repositories { google() mavenCentral() } dependencies { classpath("com.android.tools.build:gradle") // version 8.6 classpath("com.facebook.react:react-native-gradle-plugin") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin") } ...