diff --git a/coinlib_flutter/android/build.gradle b/coinlib_flutter/android/build.gradle index ac23c31..2cdb991 100644 --- a/coinlib_flutter/android/build.gradle +++ b/coinlib_flutter/android/build.gradle @@ -4,30 +4,35 @@ group 'com.example.coinlib_flutter' version '1.0' buildscript { + ext.kotlin_version = "1.8.22" repositories { google() mavenCentral() } dependencies { - // The Android Gradle Plugin knows how to build native code with the NDK. - classpath 'com.android.tools.build:gradle:7.2.0' + classpath("com.android.tools.build:gradle:8.1.0") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version") } } -rootProject.allprojects { +allprojects { repositories { google() mavenCentral() } } -apply plugin: 'com.android.library' +apply plugin: "com.android.library" +apply plugin: "kotlin-android" android { + if (project.android.hasProperty("namespace")) { + namespace = "com.example.coinlib_flutter" + } // Bumping the plugin compileSdkVersion requires all clients of this plugin // to bump the version in their app. - compileSdkVersion 31 + compileSdk = 34 // Bumping the plugin ndkVersion requires all clients of this plugin to bump // the version in their app and to download a newer version of the NDK. @@ -52,8 +57,13 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_1_8 + } + defaultConfig { - minSdkVersion 16 + minSdk 21 externalNativeBuild { cmake { // Final step in the Android build process @@ -66,6 +76,8 @@ android { main { jniLibs.srcDirs = ['src/main/jniLibs'] } + main.java.srcDirs += "src/main/kotlin" + test.java.srcDirs += "src/test/kotlin" } }