From e40384b504d9da65a81f66ac583ae61c396a3a5d Mon Sep 17 00:00:00 2001 From: Jeroen1602 <1492076+jeroen1602@users.noreply.github.com> Date: Thu, 7 Dec 2023 21:45:36 +0100 Subject: [PATCH] Updated gradle to `8.2` - Updated Android gradle plugin to `8.2.0` - Updated ndk version to `26.1` - Updated `targetSdkVersion` to `34` (Android 14) - Updated Android billing - Removed Application class that was needed for reactive ble - Removed `rxandroidble` that was needed for reactive ble --- android/app/build.gradle | 15 ++++++----- android/app/src/debug/AndroidManifest.xml | 3 +-- .../lighthouse_pm/InAppPurchases.kt | 2 +- android/app/src/main/AndroidManifest.xml | 5 ++-- .../lighthouse_pm/LighthousePMApplication.kt | 26 ------------------- android/app/src/profile/AndroidManifest.xml | 3 +-- android/build.gradle | 4 +-- android/gradle.properties | 3 +++ .../gradle/wrapper/gradle-wrapper.properties | 4 +-- 9 files changed, 21 insertions(+), 44 deletions(-) delete mode 100644 android/app/src/main/kotlin/com/jeroen1602/lighthouse_pm/LighthousePMApplication.kt diff --git a/android/app/build.gradle b/android/app/build.gradle index cd6dd1b8..3dc069ce 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -36,8 +36,8 @@ if (keystoreProperties['storeFile'] && keystoreProperties['storeFile'].contains( } android { - compileSdkVersion 33 - ndkVersion "21.3.6528147" + compileSdkVersion 34 + ndkVersion "26.1.10909125" sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -53,7 +53,7 @@ android { defaultConfig { applicationId "com.jeroen1602.lighthouse_pm" minSdkVersion 21 - targetSdkVersion 33 + targetSdkVersion 34 versionCode flutterVersionCode.toInteger() versionName flutterVersionName } @@ -72,11 +72,15 @@ android { } } + buildFeatures { + buildConfig true + } + buildTypes { release { signingConfig signingConfigs.release ndk { - abiFilters "armeabi-v7a", "arm64-v8a", "x86_64" + abiFilters "armeabi-v7a", "arm64-v8a", "x86_64", "x86" } minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' @@ -113,12 +117,11 @@ flutter { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - implementation "com.polidea.rxandroidble2:rxandroidble:1.17.2" // For now only needed for googlePlayImplementation googlePlayImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1" - def billing_version = "6.0.1" + def billing_version = "6.1.0" googlePlayImplementation "com.android.billingclient:billing:$billing_version" googlePlayImplementation "com.android.billingclient:billing-ktx:$billing_version" diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index 8cc45a60..f880684a 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/android/app/src/googlePlay/kotlin/com/jeroen1602/lighthouse_pm/InAppPurchases.kt b/android/app/src/googlePlay/kotlin/com/jeroen1602/lighthouse_pm/InAppPurchases.kt index 5967a2ee..5484822b 100644 --- a/android/app/src/googlePlay/kotlin/com/jeroen1602/lighthouse_pm/InAppPurchases.kt +++ b/android/app/src/googlePlay/kotlin/com/jeroen1602/lighthouse_pm/InAppPurchases.kt @@ -52,7 +52,7 @@ class InAppPurchases { methodChannel = MethodChannel(flutterEngine.dartExecutor.binaryMessenger, IAP_ID) methodChannel.setMethodCallHandler { call, result -> var found = false - for (handler in InMethods.values()) { + for (handler in InMethods.entries) { if (handler.functionName == call.method) { found = true CoroutineScope(Dispatchers.IO).launch { diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 46a124d4..c503c5d6 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - + @@ -22,7 +21,7 @@ additional functionality it is fine to subclass or reimplement FlutterApplication and put your custom class here. --> - if (throwable is UndeliverableException && throwable.cause is BleException) { - Log.v("LighthousePM", "Suppressed UndeliverableException: ${throwable.toString()}"); - return@setErrorHandler // ignore BleExceptions since we do not have subscriber - } else { - throw java.lang.RuntimeException( - "Unexpected Throwable in RxJavaPlugins error handler", - throwable - ); - } - } - } -} diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml index 8cc45a60..f880684a 100644 --- a/android/app/src/profile/AndroidManifest.xml +++ b/android/app/src/profile/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/android/build.gradle b/android/build.gradle index 75ddb8e2..1f259312 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.8.22' + ext.kotlin_version = '1.9.0' repositories { google() mavenCentral() } 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" } } diff --git a/android/gradle.properties b/android/gradle.properties index 80b2a893..b8161718 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -11,6 +11,9 @@ # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true #Thu Jul 16 15:57:02 CEST 2020 +android.defaults.buildfeatures.buildconfig=true android.enableJetifier=true +android.nonFinalResIds=false +android.nonTransitiveRClass=false android.useAndroidX=true org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M" diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 3eb4e99d..2471bdec 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,5 +3,5 @@ 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 -distributionSha256Sum=97a52d145762adc241bad7fd18289bf7f6801e08ece6badf80402fe2b9f250b1 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip +distributionSha256Sum=5022b0b25fe182b0e50867e77f484501dba44feeea88f5c1f13b6b4660463640