Skip to content

Commit b40a91d

Browse files
committed
Migrate to latest Android SDK, AGP and protobuf plugin
1 parent 240c3ee commit b40a91d

File tree

7 files changed

+26
-21
lines changed

7 files changed

+26
-21
lines changed

example/android/app/build.gradle

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,12 @@ apply plugin: 'kotlin-android'
2626
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2727

2828
android {
29-
compileSdkVersion 31
29+
compileSdkVersion 33
3030

3131
sourceSets {
3232
main.java.srcDirs += 'src/main/kotlin'
3333
}
3434

35-
lintOptions {
36-
disable 'InvalidPackage'
37-
}
3835

3936
compileOptions {
4037
sourceCompatibility JavaVersion.VERSION_1_8
@@ -48,7 +45,7 @@ android {
4845
defaultConfig {
4946
applicationId "com.signify.hue.reactivebleexample"
5047
minSdkVersion 21
51-
targetSdkVersion 31
48+
targetSdkVersion 33
5249
versionCode flutterVersionCode.toInteger()
5350
versionName flutterVersionName
5451
}
@@ -59,6 +56,11 @@ android {
5956
signingConfig signingConfigs.debug
6057
}
6158
}
59+
namespace 'com.signify.hue.reactivebleexample'
60+
61+
lint {
62+
disable 'InvalidPackage'
63+
}
6264
}
6365

6466
flutter {

example/android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.signify.hue.reactivebleexample">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
32

43
<uses-permission android:name="android.permission.INTERNET" />
54
<!-- required for API 18 - 30 -->

example/android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
buildscript {
2-
ext.kotlin_version = '1.5.31'
2+
ext.kotlin_version = '1.8.21'
33
repositories {
44
mavenCentral()
55
google()
66
}
77

88
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.0.2'
9+
classpath 'com.android.tools.build:gradle:8.0.2'
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1111
}
1212
}

example/android/gradle.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
android.enableJetifier=true
1+
android.defaults.buildfeatures.buildconfig=true
2+
android.enableJetifier=false
3+
android.nonFinalResIds=false
4+
android.nonTransitiveRClass=false
25
android.useAndroidX=true
36
org.gradle.jvmargs=-Xmx1536M

example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip

packages/reactive_ble_mobile/android/build.gradle

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version '1.0-SNAPSHOT'
33

44
buildscript {
55
ext.detekt_version = '1.17.1'
6-
ext.kotlin_version = '1.5.31'
6+
ext.kotlin_version = '1.8.21'
77
repositories {
88
google()
99
mavenCentral()
@@ -13,8 +13,8 @@ buildscript {
1313
}
1414

1515
dependencies {
16-
classpath 'com.android.tools.build:gradle:7.0.3'
17-
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.17'
16+
classpath 'com.android.tools.build:gradle:8.0.2'
17+
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.9.3'
1818
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1919
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detekt_version"
2020
classpath "de.mannodermaus.gradle.plugins:android-junit5:1.7.1.1"
@@ -38,7 +38,7 @@ apply plugin: "io.gitlab.arturbosch.detekt"
3838
apply plugin: "de.mannodermaus.android-junit5"
3939

4040
android {
41-
compileSdkVersion 31
41+
compileSdkVersion 33
4242
sourceSets {
4343
main.java.srcDirs += 'src/main/kotlin'
4444
test.java.srcDirs += 'src/test/kotlin'
@@ -51,11 +51,13 @@ android {
5151

5252
defaultConfig {
5353
minSdkVersion 21
54-
targetSdkVersion 31
54+
targetSdkVersion 33
5555
consumerProguardFiles 'proguard-rules.txt'
5656
}
5757

58-
lintOptions {
58+
namespace 'com.signify.hue.flutterreactiveble'
59+
60+
lint {
5961
disable 'InvalidPackage'
6062
}
6163

@@ -79,7 +81,7 @@ detekt {
7981

8082
protobuf {
8183
protoc {
82-
artifact = 'com.google.protobuf:protoc:3.18.1'
84+
artifact = 'com.google.protobuf:protoc:3.23.0'
8385
}
8486

8587
generateProtoTasks {
@@ -96,7 +98,7 @@ protobuf {
9698
dependencies {
9799
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
98100
implementation 'com.polidea.rxandroidble2:rxandroidble:1.16.0'
99-
implementation 'com.google.protobuf:protobuf-javalite:3.18.1'
101+
implementation 'com.google.protobuf:protobuf-javalite:3.23.0'
100102
implementation 'io.reactivex.rxjava2:rxkotlin:2.4.0'
101103
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
102104

packages/reactive_ble_mobile/android/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.signify.hue.flutterreactiveble">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
32

43
<!-- required for API 18 - 30 -->
54
<uses-permission

0 commit comments

Comments
 (0)