From 670f5470fb7c2107def8a8a8282e5b64fdfa4fbd Mon Sep 17 00:00:00 2001 From: Harsh Bhikadia Date: Thu, 28 Dec 2023 18:30:54 +0530 Subject: [PATCH] fix(android): upgrade to gradle 8.2 --- android/build.gradle | 12 +++++++++++- android/gradle/wrapper/gradle-wrapper.properties | 2 +- example/android/app/build.gradle | 16 +++++++++++++--- example/android/app/src/main/AndroidManifest.xml | 1 + example/android/build.gradle | 6 +++--- .../gradle/wrapper/gradle-wrapper.properties | 2 +- 6 files changed, 30 insertions(+), 9 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 3d425f0..fe07d5e 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -9,7 +9,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.2.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -28,8 +28,18 @@ android { if (project.android.hasProperty("namespace")) { namespace 'com.bhikadia.receive_intent' } + compileSdkVersion 30 + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } + sourceSets { main.java.srcDirs += 'src/main/kotlin' } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 0dfb4f8..dc159ec 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/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.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 9a4149b..2b53f3b 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -29,7 +29,17 @@ android { if (project.android.hasProperty("namespace")) { namespace "com.bhikadia.receive_intent_example" } - compileSdkVersion 30 + + compileSdkVersion flutter.compileSdkVersion + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -38,8 +48,8 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.bhikadia.receive_intent_example" - minSdkVersion 16 - targetSdkVersion 30 + minSdkVersion flutter.minSdkVersion + targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName } diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index c11d76d..3192446 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -5,6 +5,7 @@ android:icon="@mipmap/ic_launcher">