Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execution failed for task ':react-native-screens:compileDebugKotlin'. #2064

Closed
sirusbaladi opened this issue Mar 12, 2024 · 14 comments
Closed
Labels
Missing repro This issue need minimum repro scenario Platform: Android This issue is specific to Android

Comments

@sirusbaladi
Copy link

Description

When running eas build for android specifically I'm getting a build error in the gradlew.

I'm using managed expo.
I tried changing kotlin version to 1.6.21 and 1.8.0 but no success so far. here are my settings:
compileSdkVersion: 34,
targetSdkVersion: 34,
buildToolsVersion: "34.0.0",
kotlinVersikon: "1.6.21",

Detected multiple Kotlin daemon sessions at build/kotlin/sessions

  • What went wrong:
    Execution failed for task ':react-native-screens:compileDebugKotlin'.

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

Steps to reproduce

run eas build for android

Snack or a link to a repository

N/A

Screens version

"~3.20.0"

React Native version

0.71.14

Platforms

Android

JavaScript runtime

None

Workflow

Expo managed workflow

Architecture

None

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

Copy link

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 github-actions bot added Missing repro This issue need minimum repro scenario Platform: Android This issue is specific to Android labels Mar 12, 2024
@yantl0
Copy link

yantl0 commented Mar 14, 2024

same error, fixed by add import at MainActivity.kt file

import android.os.Bundle

@kkafar
Copy link
Member

kkafar commented Mar 14, 2024

Hey @yantl0, would you mind posting whole stack trace so that we can see what exactly causes the error to happen?

@kkafar kkafar added the Close when stale This issue is going to be closed when there is no activity for a while label Mar 14, 2024
@sirusbaladi
Copy link
Author

sirusbaladi commented Mar 14, 2024

same error, fixed by add import at MainActivity.kt file

import android.os.Bundle

I can't do that as i'm using a manged expo environment

@github-actions github-actions bot removed the Close when stale This issue is going to be closed when there is no activity for a while label Mar 14, 2024
@sirusbaladi
Copy link
Author

the issue is specifically for the version of react native and react-native-screens mentioned above.

@victor-axelsson
Copy link

victor-axelsson commented Apr 3, 2024

I think this might be due to some issue with using an old version of cmake.

cmake_minimum_required(VERSION 3.13)

When I install the latest version of cmake via Android studio I can see in the Android Studio SDK manager that it installed an older version, 1.18.1.

Screenshot 2024-04-03 at 09 50 14

Now, even if I uninstall the older version and set the cmake_minimum_required(VERSION 3.6.4111459) I cannot get it to work. It still installs the old version and I cannot get it to compile with the later version resulting in the compile issues.

Maybe I'm missing something with caching when I build or something? I have been stuck on this for way too long :)

@kkafar
Copy link
Member

kkafar commented Apr 12, 2024

To provide you with any help I would require you to provide me with any information about the error. All I know up to today is that you have some problems building application, no actual reproduction, no stacktrace, no insights.

@kkafar kkafar added the Close when stale This issue is going to be closed when there is no activity for a while label Apr 12, 2024
@Nikitashalimov
Copy link

Today I also faced this problem. What I didn't do, nothing helped.
It turned out that the previous developer added to the project, but did not use it, so I just deleted this package, and everything worked right away

@github-actions github-actions bot removed the Close when stale This issue is going to be closed when there is no activity for a while label Apr 25, 2024
@kkafar
Copy link
Member

kkafar commented Apr 27, 2024

I'm closing this ticket due to lacks described above.

Ping me if the situation changes.

@kkafar kkafar closed this as completed Apr 27, 2024
@ARSSHEIKH
Copy link

this not work for me

same error, fixed by add import at MainActivity.kt file

import android.os.Bundle

any update for this issue?

@SaraChicaD
Copy link

same error, fixed by add import at MainActivity.kt file

import android.os.Bundle

doing this ^^ plus implementing this last bit of native code in the instructions (my bad!) fixed it for me: https://github.com/software-mansion/react-native-screens?tab=readme-ov-file#android

@Monir-Shembesh
Copy link

@sirusbaladi did you find a solution to this issue when using expo managed workflow? issue persists in react-native 0.75.0 and react-native-screens 3.31.1

@mateus-cazuza
Copy link

Update react-native-screens for 3.27.0 work for me.

npm install [email protected]

I had that update the android/build.gradle too:

compileSdkVersion = 34
targetSdkVersion = 34
kotlinVersion = '1.8.22'

dependencies {
        ...rest
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
}

But this throw a new error when run android build:

* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class androidx.lifecycle.ViewModelLazy found in modules jetified-lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1) and lifecycle-viewmodel-2.5.0-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.0)
     Duplicate class androidx.lifecycle.ViewTreeViewModelKt found in modules jetified-lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1) and lifecycle-viewmodel-2.5.0-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.0)
     
     Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.

I'll bring you news as soon as it's resolved

@panshak
Copy link

panshak commented Dec 13, 2024

@mateus-cazuza have you been able to resolve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing repro This issue need minimum repro scenario Platform: Android This issue is specific to Android
Projects
None yet
Development

No branches or pull requests

10 participants