Skip to content

Commit 568a72f

Browse files
committed
fix(device_info_plus): Migrate Plugin to Built-in Kotlin
1 parent 6427bc6 commit 568a72f

5 files changed

Lines changed: 21 additions & 15 deletions

File tree

packages/device_info_plus/device_info_plus/android/build.gradle

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ group 'dev.fluttercommunity.plus.device_info'
22
version '1.0-SNAPSHOT'
33

44
buildscript {
5-
ext.kotlin_version = '2.2.0'
5+
ext.kotlin_version = '2.2.20'
66
repositories {
77
google()
88
mavenCentral()
@@ -22,7 +22,7 @@ rootProject.allprojects {
2222
}
2323

2424
apply plugin: 'com.android.library'
25-
apply plugin: 'kotlin-android'
25+
2626

2727
android {
2828
namespace 'dev.fluttercommunity.plus.device_info'
@@ -33,9 +33,7 @@ android {
3333
targetCompatibility JavaVersion.VERSION_17
3434
}
3535

36-
kotlinOptions {
37-
jvmTarget = 17
38-
}
36+
3937

4038
defaultConfig {
4139
minSdk 19
@@ -50,3 +48,8 @@ android {
5048
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
5149
}
5250
}
51+
kotlin {
52+
compilerOptions {
53+
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
54+
}
55+
}

packages/device_info_plus/device_info_plus/example/android/app/build.gradle

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
plugins {
22
id "com.android.application"
3-
id "kotlin-android"
43
id "dev.flutter.flutter-gradle-plugin"
54
}
65

@@ -25,16 +24,12 @@ if (flutterVersionName == null) {
2524
android {
2625
namespace 'io.flutter.plugins.deviceinfoexample.example'
2726
compileSdk = flutter.compileSdkVersion
28-
27+
ndkVersion = "28.2.13676358"
2928
compileOptions {
3029
sourceCompatibility JavaVersion.VERSION_17
3130
targetCompatibility JavaVersion.VERSION_17
3231
}
3332

34-
kotlinOptions {
35-
jvmTarget = 17
36-
}
37-
3833
sourceSets {
3934
main.java.srcDirs += 'src/main/kotlin'
4035
}
@@ -59,7 +54,11 @@ android {
5954
}
6055
}
6156
}
62-
57+
kotlin {
58+
compilerOptions {
59+
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
60+
}
61+
}
6362
flutter {
6463
source '../..'
6564
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
org.gradle.jvmargs=-Xmx1536M
22
android.useAndroidX=true
3+
# This builtInKotlin flag was added automatically by Flutter migrator
4+
android.builtInKotlin=false
5+
# This newDsl flag was added automatically by Flutter migrator
6+
android.newDsl=false
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Tue Oct 05 15:15:38 CEST 2021
22
distributionBase=GRADLE_USER_HOME
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
44
distributionPath=wrapper/dists
55
zipStorePath=wrapper/dists
66
zipStoreBase=GRADLE_USER_HOME

packages/device_info_plus/device_info_plus/example/android/settings.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ pluginManagement {
1818

1919
plugins {
2020
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21-
id "com.android.application" version "8.12.1" apply false
22-
id "org.jetbrains.kotlin.android" version "2.2.0" apply false
21+
id "com.android.application" version "8.11.1" apply false
22+
id "org.jetbrains.kotlin.android" version "2.2.20" apply false
2323
}
2424

2525
include ":app"

0 commit comments

Comments
 (0)