From 63b5c197d0aac2c8adc3ada842664b783120e544 Mon Sep 17 00:00:00 2001 From: JohnE Date: Sat, 18 Apr 2026 16:45:44 -0700 Subject: [PATCH] FIX: improved gradle to kotlin and bumped android sdk to 36 (same as app) --- android/{build.gradle => build.gradle.bak} | 39 ++++++++++++---- android/build.gradle.kts | 53 ++++++++++++++++++++++ 2 files changed, 83 insertions(+), 9 deletions(-) rename android/{build.gradle => build.gradle.bak} (54%) create mode 100644 android/build.gradle.kts diff --git a/android/build.gradle b/android/build.gradle.bak similarity index 54% rename from android/build.gradle rename to android/build.gradle.bak index c9a4fe7..1054039 100644 --- a/android/build.gradle +++ b/android/build.gradle.bak @@ -29,24 +29,45 @@ android { namespace 'com.flutter_rust_bridge.ccc_cryptography' } + compileSdk = flutter.compileSdkVersion // 36 + ndkVersion = flutter.ndkVersion // 28.2.13676358 + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + isCoreLibraryDesugaringEnabled = true + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_17.toString() + } + + defaultConfig { + applicationId = "com.letusmsg.app.ccc_cryptography" + targetSdk = flutter.targetSdkVersion // 36 + versionCode = flutter.versionCode // from pubspec.yaml, 2025.8.19+2 == 2 + versionName = flutter.versionName // from pubspec.yaml, 2025.8.19+2 == 2025.8.19 + minSdk = flutter.minSdkVersion // 24 + } + // Bumping the plugin compileSdkVersion requires all clients of this plugin // to bump the version in their app. - compileSdkVersion 33 + // compileSdkVersion 33 // Use the NDK version // declared in /android/app/build.gradle file of the Flutter project. // Replace it with a version number if this plugin requires a specfic NDK version. // (e.g. ndkVersion "23.1.7779620") - ndkVersion android.ndkVersion + // ndkVersion android.ndkVersion - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } + // compileOptions { + // sourceCompatibility JavaVersion.VERSION_1_8 + // targetCompatibility JavaVersion.VERSION_1_8 + // } - defaultConfig { - minSdkVersion 19 - } + // defaultConfig { + // minSdkVersion 19 + // } } apply from: "../cargokit/gradle/plugin.gradle" diff --git a/android/build.gradle.kts b/android/build.gradle.kts new file mode 100644 index 0000000..c973171 --- /dev/null +++ b/android/build.gradle.kts @@ -0,0 +1,53 @@ +import com.android.build.gradle.LibraryExtension +import org.gradle.kotlin.dsl.configure +import org.gradle.kotlin.dsl.withGroovyBuilder + +group = "com.flutter_rust_bridge.ccc_cryptography" +version = "1.0" + +buildscript { + repositories { + google() + mavenCentral() + } + + dependencies { + classpath("com.android.tools.build:gradle:7.3.0") + } +} + +rootProject.allprojects { + repositories { + google() + mavenCentral() + } +} + +apply(plugin = "com.android.library") +apply(from = "../cargokit/gradle/plugin.gradle") + +configure { + if (project.extensions.extraProperties.has("android") || project.extensions.findByName("android") != null) { + namespace = "com.flutter_rust_bridge.ccc_cryptography" + } + + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + defaultConfig { + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + } +} + +extensions.configure("cargokit") { + withGroovyBuilder { + setProperty("manifestDir", "../rust") + setProperty("libname", "ccc_cryptography") + } +} \ No newline at end of file