Skip to content

Commit

Permalink
fix(android): fix kotlinVersion build issue also default ot 1.7.21 in…
Browse files Browse the repository at this point in the history
…stead of 1.6.21 so compiles (#3482)
  • Loading branch information
mfazekas authored May 9, 2024
1 parent 38320cb commit a2a3c94
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ def isNewArchitectureEnabled() {
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
}


def getKotlinVersion() {
return rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : '1.6.21'
}

def getCoroutinesVersion(kotlinVersion) {
return kotlinVersion >= '1.9' ? '1.8.0' : '1.6.4'
}
Expand All @@ -30,17 +25,15 @@ if (rootProject.ext.has('expoRNMapboxMapsVersion')) {
rootProject.ext.set('RNMapboxMapsVersion', rootProject.ext.get('expoRNMapboxMapsVersion'))
}

project.ext.set("kotlinVersion", getKotlinVersion())

buildscript {
repositories {
google()
mavenCentral()
}

def kotlinVersion = this.kotlinVersion
project.ext.set("kotlinVersion", rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : '1.7.21')
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${project.kotlinVersion}"
}
}

Expand Down Expand Up @@ -153,8 +146,8 @@ dependencies {
// React Native
implementation "com.facebook.react:react-native:+"

implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:${safeExtGet('kotlinxCoroutinesCoreVersion', getCoroutinesVersion(getKotlinVersion()))}"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:${safeExtGet('kotlinxCoroutinesAndroidVersion', getCoroutinesVersion(getKotlinVersion()))}"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:${safeExtGet('kotlinxCoroutinesCoreVersion', getCoroutinesVersion(project.kotlinVersion))}"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:${safeExtGet('kotlinxCoroutinesAndroidVersion', getCoroutinesVersion(project.kotlinVersion))}"

// Mapbox SDK
customizableDependencies('RNMapboxMapsLibs') {
Expand Down

0 comments on commit a2a3c94

Please sign in to comment.