diff --git a/android/app/build.gradle b/android/app/build.gradle index 2814b9c..bf17cf3 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -40,7 +40,7 @@ android { applicationId "com.codeheadsystems.simple_otp" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. - minSdkVersion 21 + minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/android/build.gradle b/android/build.gradle index bc157bd..fc7c5a7 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -8,6 +8,30 @@ allprojects { rootProject.buildDir = '../build' subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" + + if (project.name != 'app') { + // Apply Kotlin plugin to all plugins if they have Kotlin source files + if (project.name == 'file_picker') { + apply plugin: 'kotlin-android' + } + + afterEvaluate { + if (project.hasProperty('android')) { + android { + compileOptions { + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 + } + } + + tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { + kotlinOptions { + jvmTarget = "21" + } + } + } + } + } } subprojects { project.evaluationDependsOn(':app') diff --git a/android/settings.gradle b/android/settings.gradle index d065dbb..2e46a60 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -19,7 +19,7 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version '8.3.2' apply false + id "com.android.application" version '8.6.0' apply false id "org.jetbrains.kotlin.android" version "2.1.20" apply false } diff --git a/lib/routes/database_route.dart b/lib/routes/database_route.dart index 7243999..dbc9e88 100644 --- a/lib/routes/database_route.dart +++ b/lib/routes/database_route.dart @@ -97,7 +97,7 @@ class DatabaseRoute extends StatelessWidget { void doExport(final SecretList secretList) { final String json = OTPSecret.writeToJSON(secretList.otpSecrets); - FilePicker.platform + FilePicker .saveFile( fileName: 'simple_otp.json', allowedExtensions: ['json'], @@ -117,7 +117,7 @@ class DatabaseRoute extends StatelessWidget { void doImport( final SecretList secretList, final void Function(Object) onError) async { try { - FilePickerResult? result = await FilePicker.platform.pickFiles( + FilePickerResult? result = await FilePicker.pickFiles( allowedExtensions: ['json', 'jsn'], ); if (result != null && diff --git a/pubspec.lock b/pubspec.lock index 4bafda3..e809d98 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -245,10 +245,10 @@ packages: dependency: "direct main" description: name: file_picker - sha256: d974b6ba2606371ac71dd94254beefb6fa81185bde0b59bdc1df09885da85fde + sha256: b9c6bbfe174bcc1ec1e3a0de92e9b839fe553a46dd91862debfbbb5055ca876f url: "https://pub.dev" source: hosted - version: "10.3.8" + version: "10.3.9" fixnum: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 3afe52f..876392d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -42,7 +42,7 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.6 - file_picker: ^10.3.8 + file_picker: ^10.3.9 http: ^1.6.0 dev_dependencies: