Issue
I’m encountering a build error when running my React Native project. The error message is:
Execution failed for task ‘:expo:compileDebugKotlin’.
A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
Compilation error. See log for more details
Build Configuration
Here’s the relevant section of my build.gradle file:
ext {
googlePlayServicesVersion = "+"
firebaseMessagingVersion = "21.1.0"
buildToolsVersion = "33.0.2"
minSdkVersion = 24
compileSdkVersion = 33 =>34
targetSdkVersion = 33=>34
kotlin_version = '1.9.0' newly added
if (System.properties['os.arch'] == 'aarch64') {
ndkVersion = '24.0.8215888'
} else if (Os.isFamily(Os.FAMILY_WINDOWS)) {
ndkVersion = '23.1.7779620'
} else {
ndkVersion = '21.4.7075529'
}
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath('com.android.tools.build:gradle:7.4.0')
classpath('com.facebook.react:react-native-gradle-plugin')
classpath('de.undercouch:gradle-download-task:4.1.2')
classpath('org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.1')
classpath('com.google.gms:google-services:4.3.15')
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
}
}
Dependencies
Here’s a snippet of my package.json dependencies:
"@gorhom/bottom-sheet": "^4.5.1",
"@miblanchard/react-native-slider": "^2.3.1",
"@notifee/react-native": "^7.8.0",
"@react-native-firebase/app": "^20.4.0",
"@react-native-firebase/messaging": "^20.4.0",
"@react-navigation/native": "^6.1.8",
"expo": 45.0.8 => "^46.0.0",
"react": "^17.0.2",
"react-native": "0.68.1",
"react-native-reanimated": "2.14.2",
"react-native-webview": "^13.6.3"
}
1