diff --git a/android/build.gradle b/android/build.gradle index 61cfc68..57f0428 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -11,7 +11,7 @@ buildscript { dependencies { // The Android Gradle Plugin knows how to build native code with the NDK. - classpath 'com.android.tools.build:gradle:7.3.0' + classpath 'com.android.tools.build:gradle:8.6.1' } } @@ -27,12 +27,13 @@ apply plugin: 'com.android.library' android { // Bumping the plugin compileSdkVersion requires all clients of this plugin // to bump the version in their app. - compileSdkVersion 31 + compileSdkVersion 36 namespace 'org.tensorflow.tflite_flutter' // 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. - // ndkVersion "23.1.7779620" + // Use NDK r27 or higher for 16KB page size support + // ndkVersion "28.0.12433566" // Invoke the shared CMake build with the Android Gradle Plugin. externalNativeBuild { @@ -56,13 +57,14 @@ android { defaultConfig { minSdkVersion 19 + } } dependencies { - def tflite_version = "2.11.0" - + def tflite_version = "2.12.0" + implementation("org.tensorflow:tensorflow-lite:${tflite_version}") implementation("org.tensorflow:tensorflow-lite-gpu:${tflite_version}") } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..128196a --- /dev/null +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-9.0-milestone-1-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/example/audio_classification/android/app/build.gradle b/example/audio_classification/android/app/build.gradle index 262437e..7feb023 100644 --- a/example/audio_classification/android/app/build.gradle +++ b/example/audio_classification/android/app/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -21,10 +27,6 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { namespace "org.tensorflow.audio_classification.audio_classification" compileSdkVersion flutter.compileSdkVersion @@ -49,10 +51,11 @@ android { // 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 flutter.minSdkVersion - minSdkVersion 23 + minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName + } buildTypes { diff --git a/example/audio_classification/android/build.gradle b/example/audio_classification/android/build.gradle index f7eb7f6..94a8edc 100644 --- a/example/audio_classification/android/build.gradle +++ b/example/audio_classification/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.8.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' + classpath 'com.android.tools.build:gradle:8.5.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/example/audio_classification/android/gradle/wrapper/gradle-wrapper.properties b/example/audio_classification/android/gradle/wrapper/gradle-wrapper.properties index 3c472b9..3c85cfe 100644 --- a/example/audio_classification/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/audio_classification/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip diff --git a/example/audio_classification/android/settings.gradle b/example/audio_classification/android/settings.gradle index 44e62bc..5b43c09 100644 --- a/example/audio_classification/android/settings.gradle +++ b/example/audio_classification/android/settings.gradle @@ -1,11 +1,25 @@ -include ':app' +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.6.1" apply false + id "org.jetbrains.kotlin.android" version "1.8.10" apply false +} + +include ":app" diff --git a/example/bertqa/android/app/build.gradle b/example/bertqa/android/app/build.gradle index c0a4496..c0b65dc 100644 --- a/example/bertqa/android/app/build.gradle +++ b/example/bertqa/android/app/build.gradle @@ -49,6 +49,7 @@ android { targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName + } buildTypes { diff --git a/example/bertqa/android/build.gradle b/example/bertqa/android/build.gradle index f7eb7f6..94a8edc 100644 --- a/example/bertqa/android/build.gradle +++ b/example/bertqa/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.8.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' + classpath 'com.android.tools.build:gradle:8.5.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/example/bertqa/android/gradle/wrapper/gradle-wrapper.properties b/example/bertqa/android/gradle/wrapper/gradle-wrapper.properties index 3c472b9..3c85cfe 100644 --- a/example/bertqa/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/bertqa/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip diff --git a/example/bertqa/android/settings.gradle b/example/bertqa/android/settings.gradle index 55c4ca8..5b43c09 100644 --- a/example/bertqa/android/settings.gradle +++ b/example/bertqa/android/settings.gradle @@ -5,16 +5,21 @@ pluginManagement { def flutterSdkPath = properties.getProperty("flutter.sdk") assert flutterSdkPath != null, "flutter.sdk not set in local.properties" return flutterSdkPath - } - settings.ext.flutterSdkPath = flutterSdkPath() + }() - includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") - plugins { - id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false + repositories { + google() + mavenCentral() + gradlePluginPortal() } } -include ":app" +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.6.1" apply false + id "org.jetbrains.kotlin.android" version "1.8.10" apply false +} -apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle" +include ":app" diff --git a/example/digit_classification/android/app/build.gradle b/example/digit_classification/android/app/build.gradle index 0e485b2..3ddcafc 100644 --- a/example/digit_classification/android/app/build.gradle +++ b/example/digit_classification/android/app/build.gradle @@ -49,6 +49,7 @@ android { targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName + } buildTypes { diff --git a/example/digit_classification/android/build.gradle b/example/digit_classification/android/build.gradle index f7eb7f6..94a8edc 100644 --- a/example/digit_classification/android/build.gradle +++ b/example/digit_classification/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.8.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' + classpath 'com.android.tools.build:gradle:8.5.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/example/digit_classification/android/gradle/wrapper/gradle-wrapper.properties b/example/digit_classification/android/gradle/wrapper/gradle-wrapper.properties index 3c472b9..3c85cfe 100644 --- a/example/digit_classification/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/digit_classification/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip diff --git a/example/digit_classification/android/settings.gradle b/example/digit_classification/android/settings.gradle index 55c4ca8..5b43c09 100644 --- a/example/digit_classification/android/settings.gradle +++ b/example/digit_classification/android/settings.gradle @@ -5,16 +5,21 @@ pluginManagement { def flutterSdkPath = properties.getProperty("flutter.sdk") assert flutterSdkPath != null, "flutter.sdk not set in local.properties" return flutterSdkPath - } - settings.ext.flutterSdkPath = flutterSdkPath() + }() - includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") - plugins { - id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false + repositories { + google() + mavenCentral() + gradlePluginPortal() } } -include ":app" +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.6.1" apply false + id "org.jetbrains.kotlin.android" version "1.8.10" apply false +} -apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle" +include ":app" diff --git a/example/gesture_classification/android/app/build.gradle b/example/gesture_classification/android/app/build.gradle index 8ee643c..e5caeaf 100644 --- a/example/gesture_classification/android/app/build.gradle +++ b/example/gesture_classification/android/app/build.gradle @@ -45,10 +45,11 @@ android { applicationId "org.tensorflow.gesture_classification" // 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 + } buildTypes { diff --git a/example/gesture_classification/android/build.gradle b/example/gesture_classification/android/build.gradle index f7eb7f6..94a8edc 100644 --- a/example/gesture_classification/android/build.gradle +++ b/example/gesture_classification/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.8.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' + classpath 'com.android.tools.build:gradle:8.5.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/example/gesture_classification/android/gradle/wrapper/gradle-wrapper.properties b/example/gesture_classification/android/gradle/wrapper/gradle-wrapper.properties index 3c472b9..3c85cfe 100644 --- a/example/gesture_classification/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/gesture_classification/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip diff --git a/example/gesture_classification/android/settings.gradle b/example/gesture_classification/android/settings.gradle index 55c4ca8..5b43c09 100644 --- a/example/gesture_classification/android/settings.gradle +++ b/example/gesture_classification/android/settings.gradle @@ -5,16 +5,21 @@ pluginManagement { def flutterSdkPath = properties.getProperty("flutter.sdk") assert flutterSdkPath != null, "flutter.sdk not set in local.properties" return flutterSdkPath - } - settings.ext.flutterSdkPath = flutterSdkPath() + }() - includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") - plugins { - id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false + repositories { + google() + mavenCentral() + gradlePluginPortal() } } -include ":app" +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.6.1" apply false + id "org.jetbrains.kotlin.android" version "1.8.10" apply false +} -apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle" +include ":app" diff --git a/example/image_classification_mobilenet/android/app/build.gradle b/example/image_classification_mobilenet/android/app/build.gradle index ea20b07..14c555a 100644 --- a/example/image_classification_mobilenet/android/app/build.gradle +++ b/example/image_classification_mobilenet/android/app/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -21,10 +27,6 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { namespace "org.tensorflow.image_classification_mobilenet" compileSdkVersion flutter.compileSdkVersion @@ -48,10 +50,11 @@ android { applicationId "org.tensorflow.image_classification_mobilenet" // 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 + } buildTypes { @@ -61,6 +64,12 @@ android { signingConfig signingConfigs.debug } } + + // Add 16KB page size support via packaging options + packagingOptions { + pickFirst '**/libc++_shared.so' + pickFirst '**/libjsc.so' + } } flutter { diff --git a/example/image_classification_mobilenet/android/build.gradle b/example/image_classification_mobilenet/android/build.gradle index f7eb7f6..f64aba1 100644 --- a/example/image_classification_mobilenet/android/build.gradle +++ b/example/image_classification_mobilenet/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.8.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' + classpath 'com.android.tools.build:gradle:8.6.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/example/image_classification_mobilenet/android/gradle/wrapper/gradle-wrapper.properties b/example/image_classification_mobilenet/android/gradle/wrapper/gradle-wrapper.properties index 3c472b9..3c85cfe 100644 --- a/example/image_classification_mobilenet/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/image_classification_mobilenet/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip diff --git a/example/image_classification_mobilenet/android/settings.gradle b/example/image_classification_mobilenet/android/settings.gradle index 44e62bc..5b43c09 100644 --- a/example/image_classification_mobilenet/android/settings.gradle +++ b/example/image_classification_mobilenet/android/settings.gradle @@ -1,11 +1,25 @@ -include ':app' +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.6.1" apply false + id "org.jetbrains.kotlin.android" version "1.8.10" apply false +} + +include ":app" diff --git a/example/image_segmentation/android/app/build.gradle b/example/image_segmentation/android/app/build.gradle index fe6660c..0ad36ba 100644 --- a/example/image_segmentation/android/app/build.gradle +++ b/example/image_segmentation/android/app/build.gradle @@ -45,10 +45,11 @@ android { applicationId "org.tensorflow.image_segmentation" // 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 + } buildTypes { diff --git a/example/image_segmentation/android/build.gradle b/example/image_segmentation/android/build.gradle index f7eb7f6..94a8edc 100644 --- a/example/image_segmentation/android/build.gradle +++ b/example/image_segmentation/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.8.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' + classpath 'com.android.tools.build:gradle:8.5.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/example/image_segmentation/android/gradle/wrapper/gradle-wrapper.properties b/example/image_segmentation/android/gradle/wrapper/gradle-wrapper.properties index 3c472b9..3c85cfe 100644 --- a/example/image_segmentation/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/image_segmentation/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip diff --git a/example/image_segmentation/android/settings.gradle b/example/image_segmentation/android/settings.gradle index 55c4ca8..5b43c09 100644 --- a/example/image_segmentation/android/settings.gradle +++ b/example/image_segmentation/android/settings.gradle @@ -5,16 +5,21 @@ pluginManagement { def flutterSdkPath = properties.getProperty("flutter.sdk") assert flutterSdkPath != null, "flutter.sdk not set in local.properties" return flutterSdkPath - } - settings.ext.flutterSdkPath = flutterSdkPath() + }() - includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") - plugins { - id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false + repositories { + google() + mavenCentral() + gradlePluginPortal() } } -include ":app" +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.6.1" apply false + id "org.jetbrains.kotlin.android" version "1.8.10" apply false +} -apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle" +include ":app" diff --git a/example/live_object_detection_ssd_mobilenet/android/app/build.gradle b/example/live_object_detection_ssd_mobilenet/android/app/build.gradle index 9a2ed43..4a0f190 100644 --- a/example/live_object_detection_ssd_mobilenet/android/app/build.gradle +++ b/example/live_object_detection_ssd_mobilenet/android/app/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -21,10 +27,6 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { namespace "com.example.live_object_detection_ssd_mobilenet" compileSdkVersion flutter.compileSdkVersion @@ -48,10 +50,11 @@ android { applicationId "com.example.live_object_detection_ssd_mobilenet" // 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 + } buildTypes { diff --git a/example/live_object_detection_ssd_mobilenet/android/build.gradle b/example/live_object_detection_ssd_mobilenet/android/build.gradle index f7eb7f6..94a8edc 100644 --- a/example/live_object_detection_ssd_mobilenet/android/build.gradle +++ b/example/live_object_detection_ssd_mobilenet/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.8.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' + classpath 'com.android.tools.build:gradle:8.5.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/example/live_object_detection_ssd_mobilenet/android/gradle/wrapper/gradle-wrapper.properties b/example/live_object_detection_ssd_mobilenet/android/gradle/wrapper/gradle-wrapper.properties index 3c472b9..3c85cfe 100644 --- a/example/live_object_detection_ssd_mobilenet/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/live_object_detection_ssd_mobilenet/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip diff --git a/example/live_object_detection_ssd_mobilenet/android/settings.gradle b/example/live_object_detection_ssd_mobilenet/android/settings.gradle index 44e62bc..5b43c09 100644 --- a/example/live_object_detection_ssd_mobilenet/android/settings.gradle +++ b/example/live_object_detection_ssd_mobilenet/android/settings.gradle @@ -1,11 +1,25 @@ -include ':app' +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.6.1" apply false + id "org.jetbrains.kotlin.android" version "1.8.10" apply false +} + +include ":app" diff --git a/example/object_detection_ssd_mobilenet/android/app/build.gradle b/example/object_detection_ssd_mobilenet/android/app/build.gradle index 34a61f0..4389b1c 100644 --- a/example/object_detection_ssd_mobilenet/android/app/build.gradle +++ b/example/object_detection_ssd_mobilenet/android/app/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -21,10 +27,6 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { namespace "com.example.object_detection_ssd_mobilenet" compileSdkVersion flutter.compileSdkVersion @@ -52,6 +54,7 @@ android { targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName + } buildTypes { diff --git a/example/object_detection_ssd_mobilenet/android/build.gradle b/example/object_detection_ssd_mobilenet/android/build.gradle index f7eb7f6..94a8edc 100644 --- a/example/object_detection_ssd_mobilenet/android/build.gradle +++ b/example/object_detection_ssd_mobilenet/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.8.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' + classpath 'com.android.tools.build:gradle:8.5.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/example/object_detection_ssd_mobilenet/android/gradle/wrapper/gradle-wrapper.properties b/example/object_detection_ssd_mobilenet/android/gradle/wrapper/gradle-wrapper.properties index 3c472b9..3c85cfe 100644 --- a/example/object_detection_ssd_mobilenet/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/object_detection_ssd_mobilenet/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip diff --git a/example/object_detection_ssd_mobilenet/android/settings.gradle b/example/object_detection_ssd_mobilenet/android/settings.gradle index 44e62bc..5b43c09 100644 --- a/example/object_detection_ssd_mobilenet/android/settings.gradle +++ b/example/object_detection_ssd_mobilenet/android/settings.gradle @@ -1,11 +1,25 @@ -include ':app' +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.6.1" apply false + id "org.jetbrains.kotlin.android" version "1.8.10" apply false +} + +include ":app" diff --git a/example/object_detection_ssd_mobilenet_v2/android/app/build.gradle b/example/object_detection_ssd_mobilenet_v2/android/app/build.gradle index f678aef..5ccd67b 100644 --- a/example/object_detection_ssd_mobilenet_v2/android/app/build.gradle +++ b/example/object_detection_ssd_mobilenet_v2/android/app/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -21,10 +27,6 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { namespace "com.example.object_detection_ssd_mobilenet" compileSdkVersion flutter.compileSdkVersion @@ -52,6 +54,7 @@ android { targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName + } buildTypes { diff --git a/example/object_detection_ssd_mobilenet_v2/android/build.gradle b/example/object_detection_ssd_mobilenet_v2/android/build.gradle index 3a75234..c907ef4 100644 --- a/example/object_detection_ssd_mobilenet_v2/android/build.gradle +++ b/example/object_detection_ssd_mobilenet_v2/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '2.1.0' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' + classpath 'com.android.tools.build:gradle:8.5.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/example/object_detection_ssd_mobilenet_v2/android/gradle/wrapper/gradle-wrapper.properties b/example/object_detection_ssd_mobilenet_v2/android/gradle/wrapper/gradle-wrapper.properties index 3c472b9..3c85cfe 100644 --- a/example/object_detection_ssd_mobilenet_v2/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/object_detection_ssd_mobilenet_v2/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip diff --git a/example/object_detection_ssd_mobilenet_v2/android/settings.gradle b/example/object_detection_ssd_mobilenet_v2/android/settings.gradle index 44e62bc..150ff59 100644 --- a/example/object_detection_ssd_mobilenet_v2/android/settings.gradle +++ b/example/object_detection_ssd_mobilenet_v2/android/settings.gradle @@ -1,11 +1,25 @@ -include ':app' +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.6.1" apply false + id "org.jetbrains.kotlin.android" version "2.1.0" apply false +} + +include ":app" diff --git a/example/object_detection_ssd_mobilenet_v2/pubspec.yaml b/example/object_detection_ssd_mobilenet_v2/pubspec.yaml index 7eb657d..f08fe00 100644 --- a/example/object_detection_ssd_mobilenet_v2/pubspec.yaml +++ b/example/object_detection_ssd_mobilenet_v2/pubspec.yaml @@ -34,7 +34,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.2 - tflite_flutter: ^0.10.4 + tflite_flutter: ^0.11.0 image_picker: ^0.8.8 image: ^4.0.17 diff --git a/example/pose_estimation/android/app/build.gradle b/example/pose_estimation/android/app/build.gradle index b1cecf7..f19ce5f 100644 --- a/example/pose_estimation/android/app/build.gradle +++ b/example/pose_estimation/android/app/build.gradle @@ -45,10 +45,11 @@ android { applicationId "org.tensorflow.pose_estimation" // 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 + } buildTypes { diff --git a/example/pose_estimation/android/build.gradle b/example/pose_estimation/android/build.gradle index f7eb7f6..94a8edc 100644 --- a/example/pose_estimation/android/build.gradle +++ b/example/pose_estimation/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.8.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' + classpath 'com.android.tools.build:gradle:8.5.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/example/pose_estimation/android/gradle/wrapper/gradle-wrapper.properties b/example/pose_estimation/android/gradle/wrapper/gradle-wrapper.properties index 3c472b9..3c85cfe 100644 --- a/example/pose_estimation/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/pose_estimation/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip diff --git a/example/pose_estimation/android/settings.gradle b/example/pose_estimation/android/settings.gradle index 55c4ca8..5b43c09 100644 --- a/example/pose_estimation/android/settings.gradle +++ b/example/pose_estimation/android/settings.gradle @@ -5,16 +5,21 @@ pluginManagement { def flutterSdkPath = properties.getProperty("flutter.sdk") assert flutterSdkPath != null, "flutter.sdk not set in local.properties" return flutterSdkPath - } - settings.ext.flutterSdkPath = flutterSdkPath() + }() - includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") - plugins { - id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false + repositories { + google() + mavenCentral() + gradlePluginPortal() } } -include ":app" +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.6.1" apply false + id "org.jetbrains.kotlin.android" version "1.8.10" apply false +} -apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle" +include ":app" diff --git a/example/reinforcement_learning/android/app/build.gradle b/example/reinforcement_learning/android/app/build.gradle index 644c4bd..5c49fbc 100644 --- a/example/reinforcement_learning/android/app/build.gradle +++ b/example/reinforcement_learning/android/app/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -21,10 +27,6 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { namespace "org.tensorflow.tflite_flutter.reinforcement_learning" compileSdkVersion flutter.compileSdkVersion @@ -48,10 +50,11 @@ android { applicationId "org.tensorflow.tflite_flutter.reinforcement_learning" // 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 19 + minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName + } buildTypes { diff --git a/example/reinforcement_learning/android/build.gradle b/example/reinforcement_learning/android/build.gradle index f7eb7f6..94a8edc 100644 --- a/example/reinforcement_learning/android/build.gradle +++ b/example/reinforcement_learning/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.8.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' + classpath 'com.android.tools.build:gradle:8.5.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/example/reinforcement_learning/android/gradle/wrapper/gradle-wrapper.properties b/example/reinforcement_learning/android/gradle/wrapper/gradle-wrapper.properties index 3c472b9..3c85cfe 100644 --- a/example/reinforcement_learning/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/reinforcement_learning/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip diff --git a/example/reinforcement_learning/android/settings.gradle b/example/reinforcement_learning/android/settings.gradle index 44e62bc..5b43c09 100644 --- a/example/reinforcement_learning/android/settings.gradle +++ b/example/reinforcement_learning/android/settings.gradle @@ -1,11 +1,25 @@ -include ':app' +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.6.1" apply false + id "org.jetbrains.kotlin.android" version "1.8.10" apply false +} + +include ":app" diff --git a/example/style_transfer/android/app/build.gradle b/example/style_transfer/android/app/build.gradle index 510bb3c..f0d2009 100644 --- a/example/style_transfer/android/app/build.gradle +++ b/example/style_transfer/android/app/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -21,10 +27,6 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { namespace "org.tensorflow.style_transfer" compileSdkVersion flutter.compileSdkVersion @@ -48,10 +50,11 @@ android { applicationId "org.tensorflow.style_transfer" // 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 + } buildTypes { diff --git a/example/style_transfer/android/build.gradle b/example/style_transfer/android/build.gradle index f7eb7f6..94a8edc 100644 --- a/example/style_transfer/android/build.gradle +++ b/example/style_transfer/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.8.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' + classpath 'com.android.tools.build:gradle:8.5.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/example/style_transfer/android/gradle/wrapper/gradle-wrapper.properties b/example/style_transfer/android/gradle/wrapper/gradle-wrapper.properties index 3c472b9..3c85cfe 100644 --- a/example/style_transfer/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/style_transfer/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip diff --git a/example/style_transfer/android/settings.gradle b/example/style_transfer/android/settings.gradle index 44e62bc..5b43c09 100644 --- a/example/style_transfer/android/settings.gradle +++ b/example/style_transfer/android/settings.gradle @@ -1,11 +1,25 @@ -include ':app' +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.6.1" apply false + id "org.jetbrains.kotlin.android" version "1.8.10" apply false +} + +include ":app" diff --git a/example/super_resolution_esrgan/android/app/build.gradle b/example/super_resolution_esrgan/android/app/build.gradle index 46ca893..c96bc17 100644 --- a/example/super_resolution_esrgan/android/app/build.gradle +++ b/example/super_resolution_esrgan/android/app/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -21,10 +27,6 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { namespace "org.tensorflow.super_resolution_esrgan" compileSdkVersion flutter.compileSdkVersion @@ -48,10 +50,11 @@ android { applicationId "org.tensorflow.super_resolution_esrgan" // 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 19 + minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName + } buildTypes { diff --git a/example/super_resolution_esrgan/android/build.gradle b/example/super_resolution_esrgan/android/build.gradle index f7eb7f6..94a8edc 100644 --- a/example/super_resolution_esrgan/android/build.gradle +++ b/example/super_resolution_esrgan/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.8.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' + classpath 'com.android.tools.build:gradle:8.5.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/example/super_resolution_esrgan/android/gradle/wrapper/gradle-wrapper.properties b/example/super_resolution_esrgan/android/gradle/wrapper/gradle-wrapper.properties index 3c472b9..3c85cfe 100644 --- a/example/super_resolution_esrgan/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/super_resolution_esrgan/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip diff --git a/example/super_resolution_esrgan/android/settings.gradle b/example/super_resolution_esrgan/android/settings.gradle index 44e62bc..5b43c09 100644 --- a/example/super_resolution_esrgan/android/settings.gradle +++ b/example/super_resolution_esrgan/android/settings.gradle @@ -1,11 +1,25 @@ -include ':app' +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.6.1" apply false + id "org.jetbrains.kotlin.android" version "1.8.10" apply false +} + +include ":app" diff --git a/example/text_classification/android/app/build.gradle b/example/text_classification/android/app/build.gradle index ad15823..a479699 100644 --- a/example/text_classification/android/app/build.gradle +++ b/example/text_classification/android/app/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -21,10 +27,6 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { namespace "org.tensorflow.tflite_flutter.text_classification" compileSdkVersion flutter.compileSdkVersion @@ -48,10 +50,11 @@ android { applicationId "org.tensorflow.tflite_flutter.text_classification" // 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 19 + minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName + } buildTypes { diff --git a/example/text_classification/android/build.gradle b/example/text_classification/android/build.gradle index f7eb7f6..94a8edc 100644 --- a/example/text_classification/android/build.gradle +++ b/example/text_classification/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.8.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' + classpath 'com.android.tools.build:gradle:8.5.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/example/text_classification/android/gradle/wrapper/gradle-wrapper.properties b/example/text_classification/android/gradle/wrapper/gradle-wrapper.properties index 3c472b9..3c85cfe 100644 --- a/example/text_classification/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/text_classification/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip diff --git a/example/text_classification/android/settings.gradle b/example/text_classification/android/settings.gradle index 44e62bc..5b43c09 100644 --- a/example/text_classification/android/settings.gradle +++ b/example/text_classification/android/settings.gradle @@ -1,11 +1,25 @@ -include ':app' +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.6.1" apply false + id "org.jetbrains.kotlin.android" version "1.8.10" apply false +} + +include ":app"