Skip to content

Commit bb49385

Browse files
authored
feat(android_alarm_manager_plus)!: Change Android compile SDK, update Android build config (#3665)
1 parent b49befe commit bb49385

File tree

8 files changed

+38
-32
lines changed

8 files changed

+38
-32
lines changed

packages/android_alarm_manager_plus/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ Dart code in the background when alarms fire.
1919

2020
- Flutter >=3.12.0
2121
- Dart >=3.1.0 <4.0.0
22-
- Android `compileSDK` 34
2322
- Java 17
24-
- Android Gradle Plugin >=8.3.0
25-
- Gradle wrapper >=8.4
23+
- Kotlin 2.2.0
24+
- Android Gradle Plugin >=8.12.1
25+
- Gradle wrapper >=8.13
2626

2727
## Getting Started
2828

packages/android_alarm_manager_plus/android/build.gradle

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

44
buildscript {
5-
ext.kotlin_version = '1.9.23'
5+
ext.kotlin_version = '2.2.0'
66
repositories {
77
google()
88
mavenCentral()
99
}
1010

1111
dependencies {
12-
classpath 'com.android.tools.build:gradle:8.3.1'
12+
classpath 'com.android.tools.build:gradle:8.12.1'
1313
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1414
}
1515
}
@@ -25,9 +25,8 @@ apply plugin: 'com.android.library'
2525
apply plugin: 'kotlin-android'
2626

2727
android {
28-
compileSdk 34
29-
3028
namespace 'dev.fluttercommunity.plus.androidalarmmanager'
29+
compileSdk = flutter.compileSdkVersion
3130

3231
compileOptions {
3332
sourceCompatibility JavaVersion.VERSION_17
@@ -39,7 +38,7 @@ android {
3938
}
4039

4140
defaultConfig {
42-
minSdk 19
41+
minSdk 21
4342
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4443
}
4544

@@ -50,6 +49,6 @@ android {
5049

5150
dependencies {
5251
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
53-
api 'androidx.core:core-ktx:1.13.1'
52+
api 'androidx.core:core-ktx:1.16.0'
5453
implementation 'androidx.appcompat:appcompat:1.7.0'
5554
}

packages/android_alarm_manager_plus/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 0 additions & 6 deletions
This file was deleted.

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

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
buildscript {
2+
ext.kotlin_version = '2.2.0'
3+
repositories {
4+
google()
5+
mavenCentral()
6+
}
7+
8+
dependencies {
9+
classpath 'com.android.tools.build:gradle:8.9.1'
10+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11+
}
12+
}
13+
114
plugins {
215
id "com.android.application"
316
id "kotlin-android"
@@ -23,9 +36,8 @@ if (flutterVersionName == null) {
2336
}
2437

2538
android {
26-
compileSdk 34
27-
2839
namespace 'com.example.example'
40+
compileSdk = flutter.compileSdkVersion
2941

3042
compileOptions {
3143
sourceCompatibility JavaVersion.VERSION_17
@@ -45,13 +57,13 @@ android {
4557
}
4658

4759
defaultConfig {
48-
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4960
applicationId "com.example.example"
50-
minSdk 21
51-
targetSdk 34
61+
62+
minSdk flutter.minSdkVersion
63+
targetSdk flutter.targetSdkVersion
64+
5265
versionCode flutterVersionCode.toInteger()
5366
versionName flutterVersionName
54-
multiDexEnabled true
5567
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
5668
}
5769

@@ -71,7 +83,7 @@ flutter {
7183
dependencies {
7284
testImplementation 'junit:junit:4.13.2'
7385
testImplementation "com.google.truth:truth:1.4.4"
74-
androidTestImplementation 'androidx.test:runner:1.6.1'
75-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
76-
api 'androidx.test:core:1.6.1'
86+
androidTestImplementation 'androidx.test:runner:1.7.0'
87+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.7.0'
88+
api 'androidx.test:core:1.7.0'
7789
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Tue Oct 05 12:15:50 EEST 2021
22
distributionBase=GRADLE_USER_HOME
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
44
distributionPath=wrapper/dists
55
zipStorePath=wrapper/dists
66
zipStoreBase=GRADLE_USER_HOME

packages/android_alarm_manager_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.3.1" apply false
22-
id "org.jetbrains.kotlin.android" version "1.9.23" apply false
21+
id "com.android.application" version "8.12.1" apply false
22+
id "org.jetbrains.kotlin.android" version "2.2.0" apply false
2323
}
2424

2525
include ":app"

packages/android_alarm_manager_plus/example/lib/main.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class _AlarmHomePageState extends State<_AlarmHomePage> {
8282

8383
void _checkExactAlarmPermission() async {
8484
final currentStatus = await Permission.scheduleExactAlarm.status;
85+
if (!mounted) return;
8586
setState(() {
8687
_exactAlarmPermissionStatus = currentStatus;
8788
});

packages/android_alarm_manager_plus/example/pubspec.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ name: android_alarm_manager_plus_example
22
description: Demonstrates how to use the android_alarm_manager_plus plugin.
33

44
environment:
5-
sdk: ">=2.18.0 <4.0.0"
6-
flutter: ">=3.3.0"
5+
sdk: ">=3.1.0 <4.0.0"
6+
flutter: ">=3.12.0"
77

88
dependencies:
99
flutter:
1010
sdk: flutter
1111
android_alarm_manager_plus: ^4.0.8
12-
permission_handler: ^11.3.0
13-
shared_preferences: ^2.2.2
12+
permission_handler: ^12.0.1
13+
shared_preferences: ^2.5.3
1414

1515
dev_dependencies:
16-
espresso: ^0.3.0+7
16+
espresso: ^0.4.0+11
1717
flutter_test:
1818
sdk: flutter
1919
integration_test:

0 commit comments

Comments
 (0)