software-mansion / react-native-screens

Native navigation primitives for your React Native app.
https://docs.swmansion.com/react-native-screens/
MIT License
3.1k stars 521 forks source link

Execution failed for task ':react-native-screens:compileReleaseKotlin'. #2510

Open SRI-SRINIVASAN-S opened 2 hours ago

SRI-SRINIVASAN-S commented 2 hours ago

Description

I'm using React Native Screens in my project and encountering an issue when building an APK for Android. The build fails with kotlinVersion = 1.8.0. However, downgrading to kotlinVersion = 1.6.0 resolves the issue with react-native-screens but introduces a new error in the React Native Stripe version 0.39.0 package.

Expected Behavior

The build should complete successfully with both React Native Screens and React Native Stripe working as expected.

Environment

Build.gradle File

Below is the build.gradle file for reference:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    ext {
        kotlinVersion = '1.8.0' // Causes issues with react-native-screens
        kotlinVersion = '1.6.0' // No err in react native screens if we use this kotlinVerion but err in stripe
        buildToolsVersion = "33.0.0"
        minSdkVersion = 29
        compileSdkVersion = 34
        targetSdkVersion = 33
        ndkVersion = "23.1.7779620" // We use NDK 23 which supports M1 and is compatible with AGP.
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:7.3.1")
        classpath("com.facebook.react:react-native-gradle-plugin")
        classpath("de.undercouch:gradle-download-task:5.0.1")
        classpath('com.google.gms:google-services:4.3.15')
        classpath('com.google.firebase:firebase-crashlytics-gradle:2.9.2')
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
        // NOTE: Do not place application dependencies here; they belong in module build.gradle files.
    }
}

allprojects {
    repositories {
        mavenCentral()
        mavenLocal()
        maven {
            url("$rootDir/../node_modules/react-native/android") // React Native binaries.
        }
        maven {
            url("$rootDir/../node_modules/jsc-android/dist") // Android JSC binaries.
        }
        google()
        maven { url 'https://www.jitpack.io' }
        maven { url "https://maven.google.com" }
    }
}

Additional Context

Steps to Reproduce

  1. Update your build.gradle file with kotlinVersion = 1.8.0.
  2. Attempt to build an APK for Android.
  3. Observe the compileReleaseKotlin error in the react-native-screens package.
  4. Change kotlinVersion to 1.6.0 in the build.gradle file.
  5. Build again and observe the error in the React Native Stripe package.

Snack or a link to a repository

Company profile so can't profile link.

Screens version

4.0.0

React Native version

0.71.3

Platforms

Android

JavaScript runtime

None

Workflow

None

Architecture

None

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

github-actions[bot] commented 2 hours ago

Hey! 👋

It looks like you've omitted a few important sections from the issue template.

Please complete Steps to reproduce section.

github-actions[bot] commented 2 hours ago

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?

kkafar commented 2 hours ago

@SRI-SRINIVASAN-S Hey :wave: I'm currently building react-native-screens with Kotlin version 1.9.24. It seems that we rather do not require such old Kotlin version to run :)

Also react-native 0.71 is not supported anymore with recent screens versions. See compat table