From 1562d5db80f5868715e84b010c3b5ba7d4a63965 Mon Sep 17 00:00:00 2001 From: vaishnavi-2301 Date: Wed, 17 Jul 2024 18:28:19 +0530 Subject: [PATCH] Update build.gradle and settings.gradle files according to the reference --- example/android/app/build.gradle | 37 ++++++++----------- example/android/build.gradle | 8 +--- .../gradle/wrapper/gradle-wrapper.properties | 2 +- example/android/settings.gradle | 19 +++++----- 4 files changed, 27 insertions(+), 39 deletions(-) diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index e1911eb0b..1c7c006a4 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -30,26 +30,28 @@ if (keystorePropertiesFile.exists()) { } android { - compileSdk = 34 + namespace "com.example.example" + compileSdk 34 - sourceSets { - main.java.srcDirs += 'src/main/kotlin' + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } - lintOptions { - disable 'InvalidPackage' - checkReleaseBuilds false + + kotlinOptions { + jvmTarget = '17' } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' } defaultConfig { - applicationId = "com.example.example" - minSdk = 24 - targetSdk = 33 - versionCode = flutterVersionCode.toInteger() - versionName = flutterVersionName + applicationId "com.example.example" + minSdk 24 + targetSdk 34 + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName } buildTypes { @@ -59,10 +61,6 @@ android { signingConfig signingConfigs.debug } } - - buildFeatures { - viewBinding true - } } flutter { @@ -70,7 +68,4 @@ flutter { } dependencies { - implementation 'androidx.appcompat:appcompat:1.4.1' - implementation 'com.google.android.material:material:1.5.0' } - diff --git a/example/android/build.gradle b/example/android/build.gradle index 37f57b71c..37b740654 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,10 +1,6 @@ allprojects { repositories { google() - maven { - url 'https://maven.google.com' - } - jcenter() mavenCentral() } } @@ -12,11 +8,9 @@ allprojects { rootProject.buildDir = '../build' subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { project.evaluationDependsOn(':app') } tasks.register("clean", Delete) { delete rootProject.buildDir -} +} \ No newline at end of file diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index cb046be63..2a0fcc1b8 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip diff --git a/example/android/settings.gradle b/example/android/settings.gradle index 1ad19a117..0cc6b7af9 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -1,9 +1,9 @@ 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" + 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 }() @@ -16,10 +16,9 @@ pluginManagement { } } - plugins { - id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "7.3.0" apply false - id "org.jetbrains.kotlin.android" version "2.0.0" apply false - } - -include ":app" +plugins { + id 'dev.flutter.flutter-plugin-loader' version '1.0.0' + id 'com.android.application' version '8.3.1' apply false + id 'org.jetbrains.kotlin.android' version '1.8.22' apply false +} +include ':app' \ No newline at end of file