Skip to content

Commit

Permalink
Update build.gradle and settings.gradle files according to the reference
Browse files Browse the repository at this point in the history
  • Loading branch information
vaishnavi-2301 committed Jul 17, 2024
1 parent 73f5836 commit 1562d5d
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 39 deletions.
37 changes: 16 additions & 21 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -59,18 +61,11 @@ android {
signingConfig signingConfigs.debug
}
}

buildFeatures {
viewBinding true
}
}

flutter {
source '../..'
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
}

8 changes: 1 addition & 7 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
allprojects {
repositories {
google()
maven {
url 'https://maven.google.com'
}
jcenter()
mavenCentral()
}
}

rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}

tasks.register("clean", Delete) {
delete rootProject.buildDir
}
}
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 9 additions & 10 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -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
}()

Expand All @@ -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'

0 comments on commit 1562d5d

Please sign in to comment.