diff --git a/android/build.gradle b/android/build.gradle index b3ee973..ddfe09f 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -2,7 +2,7 @@ group 'com.example.imagegallerysaver' version '1.0-SNAPSHOT' buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.8.22' repositories { google() mavenCentral() @@ -25,7 +25,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - compileSdkVersion 30 + compileSdkVersion 34 sourceSets { main.java.srcDirs += 'src/main/kotlin' diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 42e7cab..77a6fd0 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -23,7 +23,8 @@ if (flutterVersionName == null) { apply plugin: 'com.android.application' apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" +apply plugin: 'dev.flutter.flutter-gradle-plugin' +//apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { compileSdkVersion flutter.compileSdkVersion diff --git a/example/android/build.gradle b/example/android/build.gradle index f7eb7f6..1642ec0 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,15 +1,24 @@ -buildscript { - ext.kotlin_version = '1.7.10' - repositories { - google() - mavenCentral() - } +//buildscript { +// ext.kotlin_version = '1.8.22' +// repositories { +// google() +// mavenCentral() +// } +// +// dependencies { +// classpath 'com.android.tools.build:gradle:7.4.2' +// classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" +// } +//} +// +//allprojects { +// repositories { +// google() +// mavenCentral() +// } +//} - dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} +ext.kotlin_version = '1.8.22' allprojects { repositories { diff --git a/example/android/settings.gradle b/example/android/settings.gradle index f860b76..257cd33 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -1,11 +1,38 @@ -include ':app' +//include ':app' +// +//def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +//def properties = new Properties() +// +//assert localPropertiesFile.exists() +//localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } +// +//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" -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } +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 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" \ No newline at end of file + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version '7.4.2' apply false + id "org.jetbrains.kotlin.android" version "1.8.22" apply false +} + +include ":app"