diff --git a/android/build.gradle b/android/build.gradle index 42cde2190..b5d61c457 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -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' } @@ -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}" } } @@ -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') {