OiO.lk Blog Android Execution failed for task ':react-native-screens:compileReleaseKotlin'
Android

Execution failed for task ':react-native-screens:compileReleaseKotlin'


I am new to using expo.dev to build a react-native android app. I tried running this command from windows command line:

eas build --platform android

The build fails and tells me to visit the expo.dev website to find the error logs. I do so, and I see this error as being responsibel for the build failure:

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

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

   > Compilation error. See log for more details

I looked at my project and noticed that my android/build.gradle is listed in the .gitignore , which leads me to believe this file is auto-generated by the eas command? In any case, I took a look at this section of android/build.gradle:

buildscript {
    ext {
        buildToolsVersion = findProperty('android.buildToolsVersion') ?: '34.0.0'
        minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '23')
        compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '34')
        targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '34')
        if (findProperty('android.kotlinVersion')) {
            kotlinVersion = findProperty('android.kotlinVersion')
        }
        frescoVersion = findProperty('expo.frescoVersion') ?: '2.5.0'

        // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
        ndkVersion = "23.1.7779620"
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle")
        classpath('com.facebook.react:react-native-gradle-plugin')
    }
}

What I find interesting is that there is zero mention of classpath("org.jetbrains.kotlin:kotlin-gradle-plugin"), which is a line I do see in some of my colleague’s UNRELATED react-native projects.

And incase it is useful, this is my app.json

{
  "expo": {
    "name": "stuff",
    "slug": "stuff",
    "version": "1.4.14",
    "orientation": "portrait",
    "icon": "./assets/icons/appstore.png",
    "owner": "me-myself-and-i",
    "plugins": [
      "@react-native-firebase/app",
      [
        "expo-build-properties",
        {
          "android": {
            "compileSdkVersion": 34,
            "targetSdkVersion": 34,
            "buildToolsVersion": "34.0.0",
            "kotlinVersion": "1.9.24"
          },
          "ios": {
            "deploymentTarget": "13.0",
            "useFrameworks": "static"
          }
        }
      ]
    ],
    "assetBundlePatterns": ["**/*"],
    "ios": {
      "supportsTablet": false,
      "bundleIdentifier": "com.test.app",
      "googleServicesFile": "./GoogleService-Info.plist",
      "buildNumber": "1.0.0"
    },
    "android": {
      "versionCode": 24,
      "googleServicesFile": "./google-services.json",
      "package": "com.test.app",
      "icon": "./assets/logo_big_square_2.png",
      "adaptiveIcon": {
        "foregroundImage": "./assets/circle_logo.png",
        "backgroundColor": "#315564"
      }
    },
    "web": {
      "favicon": "./assets/favicon.png"
    },
    "extra": {
      "eas": {
        "projectId": "something-something-something"
      }
    }
  }
}

What am I doing wrong? Why am I getting the Kotlin error?



You need to sign in to view this answers

Exit mobile version