Skip to content

Commit

Permalink
Updated gradle to 8.2
Browse files Browse the repository at this point in the history
- Updated Android gradle plugin to `8.2.0`
- Updated ndk version to `26.1`
- Updated `targetSdkVersion` to `34` (Android 14)
- Updated Android billing
- Updated kotlinx coroutines
- Removed Application class that was needed for reactive ble
- Removed `rxandroidble` that was needed for reactive ble
  • Loading branch information
jeroen1602 committed Dec 7, 2023
1 parent d5d7628 commit 4b9141d
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 45 deletions.
17 changes: 10 additions & 7 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -53,7 +53,7 @@ android {
defaultConfig {
applicationId "com.jeroen1602.lighthouse_pm"
minSdkVersion 21
targetSdkVersion 33
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand All @@ -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'
Expand Down Expand Up @@ -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"
googlePlayImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3"

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"
Expand Down
3 changes: 1 addition & 2 deletions android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jeroen1602.lighthouse_pm">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 2 additions & 3 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jeroen1602.lighthouse_pm">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
Expand All @@ -22,7 +21,7 @@
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name=".LighthousePMApplication"
android:name="${applicationName}"
android:allowBackup="true"
android:fullBackupContent="@xml/backup_rules"
android:dataExtractionRules="@xml/backup_rules_31"
Expand Down

This file was deleted.

3 changes: 1 addition & 2 deletions android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jeroen1602.lighthouse_pm">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -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"
}
}
Expand Down
3 changes: 3 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 4b9141d

Please sign in to comment.