From 546ae3c7e68222b793b4893813a77cd6cee69e0a Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Sat, 1 Aug 2026 08:12:25 +0400 Subject: [PATCH 01/26] Fix pub score Flutter SDK setup --- .github/workflows/pub_score.yml | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/pub_score.yml b/.github/workflows/pub_score.yml index e0e7372..7a2005d 100644 --- a/.github/workflows/pub_score.yml +++ b/.github/workflows/pub_score.yml @@ -12,22 +12,20 @@ jobs: name: Check pub score runs-on: ubuntu-latest steps: - - uses: actions/checkout@v7 + - name: Checkout repository + uses: actions/checkout@v7 - - uses: axel-op/dart-package-analyzer@v3 - id: workflow + - name: Install Flutter + uses: subosito/flutter-action@v2 with: - githubToken: ${{ secrets.GITHUB_TOKEN }} + channel: stable + cache: true - - name: Check score - env: - TOTAL: ${{ steps.workflow.outputs.total }} - TOTAL_MAX: ${{ steps.workflow.outputs.total_max }} - run: | - MISSING_POINTS=$(( $TOTAL_MAX - $TOTAL )) - if (( MISSING_POINTS > 0 )) - then - echo Score can be improved! - echo Run pana to find out how. - exit 1 - fi + - name: Disable analytics + run: flutter config --no-analytics + + - name: Install pana + run: dart pub global activate pana + + - name: Check pub score + run: dart pub global run pana --exit-code-threshold 0 . From c27503847e29f4da94719c618e42f2ae15bed9d9 Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Sat, 1 Aug 2026 03:22:06 +0400 Subject: [PATCH 02/26] Restore Flutter 3.10 Android compatibility --- CHANGELOG.md | 15 +++ README.md | 8 +- android/build.gradle | 23 +++- example/android/app/build.gradle | 18 ++- example/android/settings.gradle | 1 + example/integration_test/android_id_test.dart | 109 +++++++++--------- example/lib/main.dart | 8 +- example/pubspec.lock | 6 +- example/pubspec.yaml | 3 +- example/test/android_id_example_test.dart | 4 +- pubspec.yaml | 2 +- 11 files changed, 120 insertions(+), 77 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b37e00a..0408dfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +## 0.5.3 + +* Restore Flutter 3.10 through 3.29 compatibility by using the legacy Kotlin + compiler configuration when the host still provides the Kotlin Gradle Plugin. +* Declare Kotlin Gradle Plugin 2.2.20 in the example so Flutter does not fall + back to an older soon-unsupported Kotlin version. +* Apply the example app's Kotlin Gradle Plugin only when the host build still + needs it, so the same project can be tested with legacy AGP 8 host builds. +* Add plugin Gradle fallbacks for older Flutter SDKs that do not expose + `flutter.compileSdkVersion` to plugin projects. +* Keep Kotlin JVM target configuration compatible with older supported Flutter + SDKs. +* Clarify that the package supports Flutter 3.10 or newer while its AGP 9 + example requires Flutter 3.44 or newer. + ## 0.5.2+1 * Reorder README sections. diff --git a/README.md b/README.md index 4eccae2..24c6c10 100644 --- a/README.md +++ b/README.md @@ -68,8 +68,12 @@ You can use persistent identifiers as long as you have a [privacy policy](https: ## Android build compatibility -`android_id` supports Android Gradle Plugin 9 and Flutter's built-in Kotlin mode. -It also keeps working with AGP 8 and Flutter's temporary +The published package supports Flutter 3.10 or newer. Its Android build works +with legacy Kotlin Gradle Plugin hosts and with Android Gradle Plugin 9's +built-in Kotlin support. The repository's AGP 9 example requires Flutter 3.44 +or newer; that example requirement is not the package's minimum Flutter version. + +The compatibility code also keeps working with AGP 8 and Flutter's temporary `android.builtInKotlin=false` opt-out. The plugin no longer provides its own Android Gradle Plugin or Kotlin Gradle diff --git a/android/build.gradle b/android/build.gradle index 1cdb33c..74f10d7 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -23,25 +23,36 @@ if (shouldApplyKotlinGradlePlugin) { apply plugin: 'kotlin-android' } +// Flutter 3.10 does not expose this extension to plugin library projects. +def flutterExtension = project.extensions.findByName("flutter") +def pluginCompileSdk = flutterExtension?.compileSdkVersion ?: 33 +def pluginMinSdk = flutterExtension?.minSdkVersion ?: 16 + android { if (project.android.hasProperty("namespace")) { namespace = "dev.fluttercommunity.android_id" } - compileSdk = flutter.compileSdkVersion + compileSdk = pluginCompileSdk compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 } + if (shouldApplyKotlinGradlePlugin) { + kotlinOptions { + jvmTarget = "17" + } + } + sourceSets { main.java.srcDirs += "src/main/kotlin" test.java.srcDirs += "src/test/kotlin" } defaultConfig { - minSdk = flutter.minSdkVersion + minSdk = pluginMinSdk } dependencies { @@ -62,8 +73,10 @@ android { } } -kotlin { - compilerOptions { - jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 +if (!shouldApplyKotlinGradlePlugin) { + kotlin { + compilerOptions { + jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 + } } } diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 5bed1cb..51ad46d 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -1,9 +1,23 @@ plugins { id "com.android.application" - // The Flutter Gradle Plugin must be applied after the Android Gradle plugin. - id "dev.flutter.flutter-gradle-plugin" } +def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0] as int +boolean hasBuiltInKotlinSupport = agpMajor >= 9 + +def builtInKotlinProperty = findProperty('android.builtInKotlin') +boolean isBuiltInKotlinEnabled = builtInKotlinProperty == null || + builtInKotlinProperty.toString().toBoolean() + +boolean shouldApplyKotlinGradlePlugin = !hasBuiltInKotlinSupport || !isBuiltInKotlinEnabled + +if (shouldApplyKotlinGradlePlugin) { + apply plugin: 'org.jetbrains.kotlin.android' +} + +// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. +apply plugin: "dev.flutter.flutter-gradle-plugin" + def localProperties = new Properties() def localPropertiesFile = rootProject.file("local.properties") if (localPropertiesFile.exists()) { diff --git a/example/android/settings.gradle b/example/android/settings.gradle index 6464403..f4be1ff 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -19,6 +19,7 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "com.android.application" version "9.1.1" apply false + id "org.jetbrains.kotlin.android" version "2.2.20" apply false } include ":app" diff --git a/example/integration_test/android_id_test.dart b/example/integration_test/android_id_test.dart index 3cb9290..75a62fe 100644 --- a/example/integration_test/android_id_test.dart +++ b/example/integration_test/android_id_test.dart @@ -8,72 +8,69 @@ void main() { group('AndroidId Plugin Integration Tests', () { const androidIdPlugin = AndroidId(); - testWidgets( - 'getId should not throw MissingPluginException on Android', - (WidgetTester tester) async { - // This test verifies that the plugin is properly registered - // and does not throw MissingPluginException when called on Android + testWidgets('getId should not throw MissingPluginException on Android', ( + WidgetTester tester, + ) async { + // This test verifies that the plugin is properly registered + // and does not throw MissingPluginException when called on Android - String? androidId; + String? androidId; - // Should not throw MissingPluginException - androidId = await androidIdPlugin.getId(); + // Should not throw MissingPluginException + androidId = await androidIdPlugin.getId(); - // On Android, we should get a non-null ID - // On other platforms, we should get null - expect( - androidId, - isNotNull, - reason: 'Android ID should be available on Android devices/emulators', - ); + // On Android, we should get a non-null ID + // On other platforms, we should get null + expect( + androidId, + isNotNull, + reason: 'Android ID should be available on Android devices/emulators', + ); - // Android ID should be a hex string - expect( - androidId, - matches(RegExp(r'^[0-9a-f]+$')), - reason: 'Android ID should be a hexadecimal string', - ); + // Android ID should be a hex string + expect( + androidId, + matches(RegExp(r'^[0-9a-f]+$')), + reason: 'Android ID should be a hexadecimal string', + ); - // Android ID should be 16 characters (64-bit hex) - expect( - androidId?.length, - equals(16), - reason: 'Android ID should be 16 hex characters (64-bit)', - ); - }, - ); + // Android ID should be 16 characters (64-bit hex) + expect( + androidId?.length, + equals(16), + reason: 'Android ID should be 16 hex characters (64-bit)', + ); + }); - testWidgets( - 'getId should return consistent value', - (WidgetTester tester) async { - // Call getId multiple times and verify it returns the same value - final id1 = await androidIdPlugin.getId(); - final id2 = await androidIdPlugin.getId(); + testWidgets('getId should return consistent value', ( + WidgetTester tester, + ) async { + // Call getId multiple times and verify it returns the same value + final id1 = await androidIdPlugin.getId(); + final id2 = await androidIdPlugin.getId(); - expect( - id1, - equals(id2), - reason: 'Android ID should be consistent across multiple calls', - ); - }, - ); + expect( + id1, + equals(id2), + reason: 'Android ID should be consistent across multiple calls', + ); + }); - testWidgets( - 'getId should work after hot restart', - (WidgetTester tester) async { - // This test verifies that the plugin remains registered and functional - // after pumping frames. Note: Hot restart cannot be simulated in integration tests. + testWidgets('getId should work after hot restart', ( + WidgetTester tester, + ) async { + // This test verifies that the plugin remains registered and functional + // after pumping frames. Note: Hot restart cannot be simulated in integration tests. - final id = await androidIdPlugin.getId(); - expect(id, isNotNull); + final id = await androidIdPlugin.getId(); + expect(id, isNotNull); - // Pump frames to simulate app lifecycle - await tester.pumpAndSettle(); + // Pump frames to simulate app lifecycle + await tester.pumpAndSettle(); - // Should still work - final idAfter = await androidIdPlugin.getId(); - expect(idAfter, equals(id)); - }, - ); + // Should still work + final idAfter = await androidIdPlugin.getId(); + expect(idAfter, equals(id)); + }); }); } diff --git a/example/lib/main.dart b/example/lib/main.dart index 155de41..69c4a1e 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -47,12 +47,8 @@ class _MyAppState extends State { Widget build(BuildContext context) { return MaterialApp( home: Scaffold( - appBar: AppBar( - title: const Text('Plugin example app'), - ), - body: Center( - child: Text('Android ID: $_androidId'), - ), + appBar: AppBar(title: const Text('Plugin example app')), + body: Center(child: Text('Android ID: $_androidId')), ), ); } diff --git a/example/pubspec.lock b/example/pubspec.lock index 5d10413..7a5a74e 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -7,7 +7,7 @@ packages: path: ".." relative: true source: path - version: "0.5.2+1" + version: "0.5.3" async: dependency: transitive description: @@ -263,5 +263,5 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=3.10.0-0 <4.0.0" - flutter: ">=3.18.0-18.0.pre.54" + dart: ">=3.12.0 <4.0.0" + flutter: ">=3.44.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index e2ef583..9594a01 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -7,7 +7,8 @@ version: 1.0.0+1 publish_to: 'none' environment: - sdk: '>=3.0.0 <4.0.0' + sdk: ^3.12.0 + flutter: '>=3.44.0' dependencies: flutter: diff --git a/example/test/android_id_example_test.dart b/example/test/android_id_example_test.dart index 6530893..44f862e 100644 --- a/example/test/android_id_example_test.dart +++ b/example/test/android_id_example_test.dart @@ -18,7 +18,9 @@ void main() { setUp(() { TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler( - channel, (MethodCall methodCall) async => '42'); + channel, + (MethodCall methodCall) async => '42', + ); }); tearDown(() { diff --git a/pubspec.yaml b/pubspec.yaml index 9c7d41c..52456ca 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -13,7 +13,7 @@ topics: - android - native -version: 0.5.2+1 +version: 0.5.3 environment: sdk: '>=3.0.0 <4.0.0' From a1595559fa7f7826f249f0c44bd156a60a51ba57 Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Sat, 1 Aug 2026 06:00:06 +0400 Subject: [PATCH 03/26] Require Flutter 3.44 and adopt AGP 9 Kotlin support --- CHANGELOG.md | 7 +++++ README.md | 16 ++++------- android/build.gradle | 46 ++++--------------------------- example/android/app/build.gradle | 18 ++---------- example/android/gradle.properties | 1 - example/android/settings.gradle | 1 - example/pubspec.lock | 2 +- pubspec.yaml | 4 +-- 8 files changed, 24 insertions(+), 71 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0408dfa..c6c241c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 0.6.0 + +* **Breaking:** Require Flutter 3.44 and Android API 24 or newer. +* Remove the plugin-owned Kotlin Gradle Plugin so host apps can use Android + Gradle Plugin 9's built-in Kotlin support. +* Update the Android example to Android Gradle Plugin 9.1.1 and Gradle 9.3.1. + ## 0.5.3 * Restore Flutter 3.10 through 3.29 compatibility by using the legacy Kotlin diff --git a/README.md b/README.md index 24c6c10..a5d1b7b 100644 --- a/README.md +++ b/README.md @@ -68,17 +68,13 @@ You can use persistent identifiers as long as you have a [privacy policy](https: ## Android build compatibility -The published package supports Flutter 3.10 or newer. Its Android build works -with legacy Kotlin Gradle Plugin hosts and with Android Gradle Plugin 9's -built-in Kotlin support. The repository's AGP 9 example requires Flutter 3.44 -or newer; that example requirement is not the package's minimum Flutter version. +`android_id` 0.6.0 or newer requires Flutter 3.44 and Android API 24 or newer. +The plugin does not apply or provide a Kotlin Gradle Plugin; this keeps the +Android build compatible with Android Gradle Plugin 9's built-in Kotlin support. +AGP 8 hosts can still build when the host app applies a compatible Kotlin +Gradle Plugin; `android_id` no longer configures that legacy toolchain. -The compatibility code also keeps working with AGP 8 and Flutter's temporary -`android.builtInKotlin=false` opt-out. - -The plugin no longer provides its own Android Gradle Plugin or Kotlin Gradle -Plugin classpaths. It only applies the Kotlin Gradle Plugin when the host build -still needs it. This fixes errors such as: +This fixes errors such as: ```text The 'org.jetbrains.kotlin.android' plugin is no longer required for Kotlin diff --git a/android/build.gradle b/android/build.gradle index 74f10d7..2353063 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -10,49 +10,17 @@ allprojects { apply plugin: "com.android.library" -def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0] as int -boolean hasBuiltInKotlinSupport = agpMajor >= 9 - -def builtInKotlinProperty = findProperty('android.builtInKotlin') -boolean isBuiltInKotlinEnabled = builtInKotlinProperty == null || - builtInKotlinProperty.toString().toBoolean() - -boolean shouldApplyKotlinGradlePlugin = !hasBuiltInKotlinSupport || !isBuiltInKotlinEnabled - -if (shouldApplyKotlinGradlePlugin) { - apply plugin: 'kotlin-android' -} - -// Flutter 3.10 does not expose this extension to plugin library projects. -def flutterExtension = project.extensions.findByName("flutter") -def pluginCompileSdk = flutterExtension?.compileSdkVersion ?: 33 -def pluginMinSdk = flutterExtension?.minSdkVersion ?: 16 - android { - if (project.android.hasProperty("namespace")) { - namespace = "dev.fluttercommunity.android_id" - } - - compileSdk = pluginCompileSdk + namespace = "dev.fluttercommunity.android_id" + compileSdk = flutter.compileSdkVersion compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 } - if (shouldApplyKotlinGradlePlugin) { - kotlinOptions { - jvmTarget = "17" - } - } - - sourceSets { - main.java.srcDirs += "src/main/kotlin" - test.java.srcDirs += "src/test/kotlin" - } - defaultConfig { - minSdk = pluginMinSdk + minSdk = 24 } dependencies { @@ -73,10 +41,8 @@ android { } } -if (!shouldApplyKotlinGradlePlugin) { - kotlin { - compilerOptions { - jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 - } +kotlin { + compilerOptions { + jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 } } diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 51ad46d..5bed1cb 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -1,23 +1,9 @@ plugins { id "com.android.application" + // The Flutter Gradle Plugin must be applied after the Android Gradle plugin. + id "dev.flutter.flutter-gradle-plugin" } -def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0] as int -boolean hasBuiltInKotlinSupport = agpMajor >= 9 - -def builtInKotlinProperty = findProperty('android.builtInKotlin') -boolean isBuiltInKotlinEnabled = builtInKotlinProperty == null || - builtInKotlinProperty.toString().toBoolean() - -boolean shouldApplyKotlinGradlePlugin = !hasBuiltInKotlinSupport || !isBuiltInKotlinEnabled - -if (shouldApplyKotlinGradlePlugin) { - apply plugin: 'org.jetbrains.kotlin.android' -} - -// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. -apply plugin: "dev.flutter.flutter-gradle-plugin" - def localProperties = new Properties() def localPropertiesFile = rootProject.file("local.properties") if (localPropertiesFile.exists()) { diff --git a/example/android/gradle.properties b/example/android/gradle.properties index 3b5b324..9112aa5 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -1,3 +1,2 @@ org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true -android.enableJetifier=true diff --git a/example/android/settings.gradle b/example/android/settings.gradle index f4be1ff..6464403 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -19,7 +19,6 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "com.android.application" version "9.1.1" apply false - id "org.jetbrains.kotlin.android" version "2.2.20" apply false } include ":app" diff --git a/example/pubspec.lock b/example/pubspec.lock index 7a5a74e..8a6c2a9 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -7,7 +7,7 @@ packages: path: ".." relative: true source: path - version: "0.5.3" + version: "0.6.0" async: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 52456ca..2b7ab06 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -13,11 +13,11 @@ topics: - android - native -version: 0.5.3 +version: 0.6.0 environment: sdk: '>=3.0.0 <4.0.0' - flutter: '>=3.10.0' + flutter: '>=3.44.0' dependencies: flutter: From afedcf60b6cd3339b014382d6b0ec388dbed29af Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Thu, 13 Aug 2026 12:49:13 +0400 Subject: [PATCH 04/26] Remove obsolete compatibility release notes --- CHANGELOG.md | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6c241c..d90083b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,21 +5,6 @@ Gradle Plugin 9's built-in Kotlin support. * Update the Android example to Android Gradle Plugin 9.1.1 and Gradle 9.3.1. -## 0.5.3 - -* Restore Flutter 3.10 through 3.29 compatibility by using the legacy Kotlin - compiler configuration when the host still provides the Kotlin Gradle Plugin. -* Declare Kotlin Gradle Plugin 2.2.20 in the example so Flutter does not fall - back to an older soon-unsupported Kotlin version. -* Apply the example app's Kotlin Gradle Plugin only when the host build still - needs it, so the same project can be tested with legacy AGP 8 host builds. -* Add plugin Gradle fallbacks for older Flutter SDKs that do not expose - `flutter.compileSdkVersion` to plugin projects. -* Keep Kotlin JVM target configuration compatible with older supported Flutter - SDKs. -* Clarify that the package supports Flutter 3.10 or newer while its AGP 9 - example requires Flutter 3.44 or newer. - ## 0.5.2+1 * Reorder README sections. From a2bb4f4473268c3848fa7910b6010ea2ada91844 Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Thu, 13 Aug 2026 13:43:27 +0400 Subject: [PATCH 05/26] Update the Android example to AGP 9.2.1 --- CHANGELOG.md | 2 +- example/android/gradle/wrapper/gradle-wrapper.properties | 2 +- example/android/settings.gradle | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d90083b..5fef07d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ * **Breaking:** Require Flutter 3.44 and Android API 24 or newer. * Remove the plugin-owned Kotlin Gradle Plugin so host apps can use Android Gradle Plugin 9's built-in Kotlin support. -* Update the Android example to Android Gradle Plugin 9.1.1 and Gradle 9.3.1. +* Update the Android example to Android Gradle Plugin 9.2.1 and Gradle 9.4.1. ## 0.5.2+1 diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index bdc0141..6d24045 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip diff --git a/example/android/settings.gradle b/example/android/settings.gradle index 6464403..4846656 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -18,7 +18,7 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "9.1.1" apply false + id "com.android.application" version "9.2.1" apply false } include ":app" From 07c3085b50d345d7b04e7176fcf0eb8ddc760a5d Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Tue, 15 Sep 2026 15:13:52 +0400 Subject: [PATCH 06/26] Update the Android wrapper to Gradle 9.7.1 --- example/android/gradle.properties | 2 ++ example/android/gradle/wrapper/gradle-wrapper.properties | 2 +- example/android/settings.gradle | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/example/android/gradle.properties b/example/android/gradle.properties index 9112aa5..20361af 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -1,2 +1,4 @@ org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true +android.builtInKotlin=true +android.newDsl=false diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index 6d24045..22d1452 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip diff --git a/example/android/settings.gradle b/example/android/settings.gradle index 4846656..3c6782b 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -19,6 +19,7 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "com.android.application" version "9.2.1" apply false + id "org.jetbrains.kotlin.android" version "2.4.20" apply false } include ":app" From e600376f11a7861ae78e96577fd156fdc4c8f71d Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Tue, 15 Sep 2026 19:07:56 +0400 Subject: [PATCH 07/26] Standardize package formatting at 120 columns --- .github/workflows/flutter_checks.yml | 2 +- example/analysis_options.yaml | 3 ++ example/integration_test/android_id_test.dart | 36 ++++--------------- example/test/android_id_example_test.dart | 12 +++---- lib/android_id.dart | 3 +- test/android_id_test.dart | 3 +- 6 files changed, 18 insertions(+), 41 deletions(-) diff --git a/.github/workflows/flutter_checks.yml b/.github/workflows/flutter_checks.yml index df929c1..a53a189 100644 --- a/.github/workflows/flutter_checks.yml +++ b/.github/workflows/flutter_checks.yml @@ -49,7 +49,7 @@ jobs: run: flutter pub get - name: Check Dart formatting - run: dart format --line-length 80 --set-exit-if-changed . + run: dart format --page-width 120 --set-exit-if-changed . analyze: name: Dart analyze diff --git a/example/analysis_options.yaml b/example/analysis_options.yaml index f9b3034..76940e6 100644 --- a/example/analysis_options.yaml +++ b/example/analysis_options.yaml @@ -1 +1,4 @@ include: package:flutter_lints/flutter.yaml + +formatter: + page_width: 120 diff --git a/example/integration_test/android_id_test.dart b/example/integration_test/android_id_test.dart index 75a62fe..b143e66 100644 --- a/example/integration_test/android_id_test.dart +++ b/example/integration_test/android_id_test.dart @@ -8,9 +8,7 @@ void main() { group('AndroidId Plugin Integration Tests', () { const androidIdPlugin = AndroidId(); - testWidgets('getId should not throw MissingPluginException on Android', ( - WidgetTester tester, - ) async { + testWidgets('getId should not throw MissingPluginException on Android', (WidgetTester tester) async { // This test verifies that the plugin is properly registered // and does not throw MissingPluginException when called on Android @@ -21,44 +19,24 @@ void main() { // On Android, we should get a non-null ID // On other platforms, we should get null - expect( - androidId, - isNotNull, - reason: 'Android ID should be available on Android devices/emulators', - ); + expect(androidId, isNotNull, reason: 'Android ID should be available on Android devices/emulators'); // Android ID should be a hex string - expect( - androidId, - matches(RegExp(r'^[0-9a-f]+$')), - reason: 'Android ID should be a hexadecimal string', - ); + expect(androidId, matches(RegExp(r'^[0-9a-f]+$')), reason: 'Android ID should be a hexadecimal string'); // Android ID should be 16 characters (64-bit hex) - expect( - androidId?.length, - equals(16), - reason: 'Android ID should be 16 hex characters (64-bit)', - ); + expect(androidId?.length, equals(16), reason: 'Android ID should be 16 hex characters (64-bit)'); }); - testWidgets('getId should return consistent value', ( - WidgetTester tester, - ) async { + testWidgets('getId should return consistent value', (WidgetTester tester) async { // Call getId multiple times and verify it returns the same value final id1 = await androidIdPlugin.getId(); final id2 = await androidIdPlugin.getId(); - expect( - id1, - equals(id2), - reason: 'Android ID should be consistent across multiple calls', - ); + expect(id1, equals(id2), reason: 'Android ID should be consistent across multiple calls'); }); - testWidgets('getId should work after hot restart', ( - WidgetTester tester, - ) async { + testWidgets('getId should work after hot restart', (WidgetTester tester) async { // This test verifies that the plugin remains registered and functional // after pumping frames. Note: Hot restart cannot be simulated in integration tests. diff --git a/example/test/android_id_example_test.dart b/example/test/android_id_example_test.dart index 44f862e..5100a36 100644 --- a/example/test/android_id_example_test.dart +++ b/example/test/android_id_example_test.dart @@ -16,16 +16,14 @@ void main() { TestWidgetsFlutterBinding.ensureInitialized(); setUp(() { - TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger - .setMockMethodCallHandler( - channel, - (MethodCall methodCall) async => '42', - ); + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler( + channel, + (MethodCall methodCall) async => '42', + ); }); tearDown(() { - TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger - .setMockMethodCallHandler(channel, null); + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler(channel, null); }); testWidgets('Gets and displays Android ID', (WidgetTester tester) async { diff --git a/lib/android_id.dart b/lib/android_id.dart index 760e177..ae46053 100644 --- a/lib/android_id.dart +++ b/lib/android_id.dart @@ -10,8 +10,7 @@ class AndroidId { /// Calls the native method to retrieve the Android ID. Future getId() async { - final isAndroid = - !kIsWeb && defaultTargetPlatform == TargetPlatform.android; + final isAndroid = !kIsWeb && defaultTargetPlatform == TargetPlatform.android; if (!isAndroid) return null; return _methodChannel.invokeMethod('getId'); diff --git a/test/android_id_test.dart b/test/android_id_test.dart index 6ffada6..4c45285 100644 --- a/test/android_id_test.dart +++ b/test/android_id_test.dart @@ -17,8 +17,7 @@ void main() { }); tearDown(() { - TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger - .setMockMethodCallHandler(channel, null); + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler(channel, null); }); test('getAndroidId', () async { From ac0a2b2a7597ae5eb36ddda065a0ff0b14c7d26b Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Tue, 15 Sep 2026 21:49:29 +0400 Subject: [PATCH 08/26] Teach Pana the package formatter width --- analysis_options.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/analysis_options.yaml b/analysis_options.yaml index f9b3034..76940e6 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1 +1,4 @@ include: package:flutter_lints/flutter.yaml + +formatter: + page_width: 120 From 0657298fbfa1fbfd4992e9f076bd1f209a350eb1 Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Fri, 18 Sep 2026 14:04:53 +0400 Subject: [PATCH 09/26] Correct Android migration documentation --- CHANGELOG.md | 2 +- README.md | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fef07d..98dce2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ * **Breaking:** Require Flutter 3.44 and Android API 24 or newer. * Remove the plugin-owned Kotlin Gradle Plugin so host apps can use Android Gradle Plugin 9's built-in Kotlin support. -* Update the Android example to Android Gradle Plugin 9.2.1 and Gradle 9.4.1. +* Update the Android example to Android Gradle Plugin 9.2.1 and Gradle 9.7.1. ## 0.5.2+1 diff --git a/README.md b/README.md index a5d1b7b..6ba04f5 100644 --- a/README.md +++ b/README.md @@ -68,11 +68,9 @@ You can use persistent identifiers as long as you have a [privacy policy](https: ## Android build compatibility -`android_id` 0.6.0 or newer requires Flutter 3.44 and Android API 24 or newer. -The plugin does not apply or provide a Kotlin Gradle Plugin; this keeps the -Android build compatible with Android Gradle Plugin 9's built-in Kotlin support. -AGP 8 hosts can still build when the host app applies a compatible Kotlin -Gradle Plugin; `android_id` no longer configures that legacy toolchain. +`android_id` 0.6.0 or newer requires Flutter 3.44, Android Gradle Plugin 9's +built-in Kotlin support, and Android API 24 or newer. The plugin does not apply +or provide a separate Kotlin Gradle Plugin. This fixes errors such as: From 7c7a248f3a6a583fa2eaaece771ce095526a8224 Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Fri, 18 Sep 2026 15:35:35 +0400 Subject: [PATCH 10/26] Require Flutter 3.47 for built-in Kotlin --- CHANGELOG.md | 2 +- README.md | 4 ++-- analysis_options.yaml | 4 ++++ example/analysis_options.yaml | 4 ++++ example/pubspec.lock | 18 +++++++++--------- example/pubspec.yaml | 2 +- pubspec.yaml | 2 +- 7 files changed, 22 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98dce2e..3299eb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## 0.6.0 -* **Breaking:** Require Flutter 3.44 and Android API 24 or newer. +* **Breaking:** Require Flutter 3.47 and Android API 24 or newer. * Remove the plugin-owned Kotlin Gradle Plugin so host apps can use Android Gradle Plugin 9's built-in Kotlin support. * Update the Android example to Android Gradle Plugin 9.2.1 and Gradle 9.7.1. diff --git a/README.md b/README.md index 6ba04f5..82f1c48 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ You can use persistent identifiers as long as you have a [privacy policy](https: ## Android build compatibility -`android_id` 0.6.0 or newer requires Flutter 3.44, Android Gradle Plugin 9's +`android_id` 0.6.0 or newer requires Flutter 3.47, Android Gradle Plugin 9's built-in Kotlin support, and Android API 24 or newer. The plugin does not apply or provide a separate Kotlin Gradle Plugin. @@ -92,7 +92,7 @@ If you're experiencing `MissingPluginException`, try these steps in order: flutter run ``` -2. **Check Flutter Version**: Ensure you're using Flutter 3.10.0 or higher +2. **Check Flutter Version**: Ensure you're using Flutter 3.47.0 or higher ```bash flutter --version ``` diff --git a/analysis_options.yaml b/analysis_options.yaml index 76940e6..e95c400 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -2,3 +2,7 @@ include: package:flutter_lints/flutter.yaml formatter: page_width: 120 +analyzer: + exclude: + - build/** + - android/** diff --git a/example/analysis_options.yaml b/example/analysis_options.yaml index 76940e6..e95c400 100644 --- a/example/analysis_options.yaml +++ b/example/analysis_options.yaml @@ -2,3 +2,7 @@ include: package:flutter_lints/flutter.yaml formatter: page_width: 120 +analyzer: + exclude: + - build/** + - android/** diff --git a/example/pubspec.lock b/example/pubspec.lock index 8a6c2a9..2ac18d7 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -133,10 +133,10 @@ packages: dependency: transitive description: name: matcher - sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861 + sha256: "31bd099b47c10cd1aeb55146a2d46ce0277630ecef3f7dae54ad7873f36696cd" url: "https://pub.dev" source: hosted - version: "0.12.19" + version: "0.12.20" material_color_utilities: dependency: transitive description: @@ -149,10 +149,10 @@ packages: dependency: transitive description: name: meta - sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349" + sha256: "307249ce4ff29d58a18e97f6345f539382eb9c9c29ecda628900f31de0443dd9" url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.19.0" path: dependency: transitive description: @@ -234,18 +234,18 @@ packages: dependency: transitive description: name: test_api - sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e" + sha256: "2a122cbe059f8b610d3a5415f42e255b6c17b1f21eee1d960f31080237fb4f11" url: "https://pub.dev" source: hosted - version: "0.7.11" + version: "0.7.12" vector_math: dependency: transitive description: name: vector_math - sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b + sha256: f36f9f3be64c6198714492bb455c11056e33e2f85d9a0b676a48301e44fdcf47 url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.4.2" vm_service: dependency: transitive description: @@ -264,4 +264,4 @@ packages: version: "3.1.0" sdks: dart: ">=3.12.0 <4.0.0" - flutter: ">=3.44.0" + flutter: ">=3.47.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 9594a01..516abf6 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -8,7 +8,7 @@ publish_to: 'none' environment: sdk: ^3.12.0 - flutter: '>=3.44.0' + flutter: '>=3.47.0' dependencies: flutter: diff --git a/pubspec.yaml b/pubspec.yaml index 2b7ab06..be9096f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,7 @@ version: 0.6.0 environment: sdk: '>=3.0.0 <4.0.0' - flutter: '>=3.44.0' + flutter: '>=3.47.0' dependencies: flutter: From 3ef04aa2da8bf0864eb14568a06b0734d2c8e287 Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Fri, 18 Sep 2026 16:24:08 +0400 Subject: [PATCH 11/26] Accept unpadded Android IDs in integration tests --- example/integration_test/android_id_test.dart | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/example/integration_test/android_id_test.dart b/example/integration_test/android_id_test.dart index b143e66..ca794c6 100644 --- a/example/integration_test/android_id_test.dart +++ b/example/integration_test/android_id_test.dart @@ -21,11 +21,12 @@ void main() { // On other platforms, we should get null expect(androidId, isNotNull, reason: 'Android ID should be available on Android devices/emulators'); - // Android ID should be a hex string - expect(androidId, matches(RegExp(r'^[0-9a-f]+$')), reason: 'Android ID should be a hexadecimal string'); - - // Android ID should be 16 characters (64-bit hex) - expect(androidId?.length, equals(16), reason: 'Android ID should be 16 hex characters (64-bit)'); + // Android formats this 64-bit value without leading zeroes. + expect( + androidId, + matches(RegExp(r'^[0-9a-f]{1,16}$')), + reason: 'Android ID should be a 64-bit hexadecimal string', + ); }); testWidgets('getId should return consistent value', (WidgetTester tester) async { From a3d238d4c9abf0bb07d986276a94c9f5213ca4fc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 27 Aug 2026 18:42:30 +0000 Subject: [PATCH 12/26] Bump actions/setup-java from 5 to 6 Bumps [actions/setup-java](https://github.com/actions/setup-java) from 5 to 6. - [Release notes](https://github.com/actions/setup-java/releases) - [Commits](https://github.com/actions/setup-java/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/setup-java dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/flutter_build_example.yml | 2 +- .github/workflows/integration_tests_android.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/flutter_build_example.yml b/.github/workflows/flutter_build_example.yml index be5c1c2..9608adc 100644 --- a/.github/workflows/flutter_build_example.yml +++ b/.github/workflows/flutter_build_example.yml @@ -17,7 +17,7 @@ jobs: uses: actions/checkout@v7 - name: Setup Java - uses: actions/setup-java@v5 + uses: actions/setup-java@v6 with: distribution: temurin java-version: 17 diff --git a/.github/workflows/integration_tests_android.yml b/.github/workflows/integration_tests_android.yml index cb35b2c..4eb2506 100644 --- a/.github/workflows/integration_tests_android.yml +++ b/.github/workflows/integration_tests_android.yml @@ -27,7 +27,7 @@ jobs: uses: actions/checkout@v7 - name: Setup Java - uses: actions/setup-java@v5 + uses: actions/setup-java@v6 with: distribution: temurin java-version: 17 From fab8d6e257b89cf977534111fcbabc5cf496df31 Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Sat, 1 Aug 2026 09:07:04 +0400 Subject: [PATCH 13/26] ci: run Dart analyzer directly --- .github/workflows/flutter_checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flutter_checks.yml b/.github/workflows/flutter_checks.yml index a53a189..4251e49 100644 --- a/.github/workflows/flutter_checks.yml +++ b/.github/workflows/flutter_checks.yml @@ -72,7 +72,7 @@ jobs: run: flutter pub get - name: Run Dart analyze - uses: invertase/github-action-dart-analyzer@v3.0.0 + run: dart analyze test: name: Flutter test From 494a7b0a0e17e95d8975b8db61934885a87e7b0a Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Fri, 18 Sep 2026 14:08:53 +0400 Subject: [PATCH 14/26] Treat analyzer infos as CI failures --- .github/workflows/flutter_checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flutter_checks.yml b/.github/workflows/flutter_checks.yml index 4251e49..ac48893 100644 --- a/.github/workflows/flutter_checks.yml +++ b/.github/workflows/flutter_checks.yml @@ -72,7 +72,7 @@ jobs: run: flutter pub get - name: Run Dart analyze - run: dart analyze + run: dart analyze --fatal-infos test: name: Flutter test From 7812d9677569679e87a3714671d827f66a693b2c Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Sat, 1 Aug 2026 05:25:20 +0400 Subject: [PATCH 15/26] Limit Dependabot to major GitHub Actions updates --- .github/dependabot.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 37fa693..2f95e01 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,6 +9,9 @@ updates: directory: "/" schedule: interval: "daily" + ignore: + - dependency-name: "*" + update-types: ["version-update:semver-minor", "version-update:semver-patch"] - package-ecosystem: "pub" directory: "/" From 815175e56d847fb48b1fc5fb195b495b35db006f Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Sat, 1 Aug 2026 09:05:27 +0400 Subject: [PATCH 16/26] ci: use official Dart publishing --- .github/workflows/pub_publish.yml | 16 ++++++---------- .github/workflows/pub_publish_dry_run.yml | 20 +++++++++++++++----- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pub_publish.yml b/.github/workflows/pub_publish.yml index 3a51984..130f8c1 100644 --- a/.github/workflows/pub_publish.yml +++ b/.github/workflows/pub_publish.yml @@ -1,17 +1,13 @@ name: Pub publish on: - release: - types: [published] + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+*' jobs: publish: name: Pub publish - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v7 - - - name: Publish - uses: k-paxian/dart-package-publisher@v1.6 - with: - credentialJson: ${{ secrets.CREDENTIALS }} + permissions: + id-token: write + uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 diff --git a/.github/workflows/pub_publish_dry_run.yml b/.github/workflows/pub_publish_dry_run.yml index fd2dff7..ba095f7 100644 --- a/.github/workflows/pub_publish_dry_run.yml +++ b/.github/workflows/pub_publish_dry_run.yml @@ -11,10 +11,20 @@ jobs: name: Pub publish dry run runs-on: ubuntu-latest steps: - - uses: actions/checkout@v7 + - name: Checkout repository + uses: actions/checkout@v7 - - name: Publish dry run - uses: k-paxian/dart-package-publisher@v1.6 + - name: Install Flutter + uses: subosito/flutter-action@v2 with: - credentialJson: MockCredentialJson - dryRunOnly: true + channel: stable + cache: true + + - name: Disable analytics + run: flutter config --no-analytics + + - name: Flutter pub get + run: flutter pub get + + - name: Publish dry run + run: dart pub publish --dry-run From 84c31cc06e9b4507169d8719b981d27c98081174 Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Fri, 18 Sep 2026 06:48:34 +0400 Subject: [PATCH 17/26] Verify packages before publishing --- .github/workflows/pub_publish.yml | 23 +++++++++++++++++++++++ .github/workflows/pub_publish_dry_run.yml | 6 +++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pub_publish.yml b/.github/workflows/pub_publish.yml index 130f8c1..fab7807 100644 --- a/.github/workflows/pub_publish.yml +++ b/.github/workflows/pub_publish.yml @@ -6,8 +6,31 @@ on: - '[0-9]+.[0-9]+.[0-9]+*' jobs: + verify: + name: Verify package + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v7 + + - name: Install Flutter + uses: subosito/flutter-action@v2 + with: + channel: stable + cache: true + + - name: Disable analytics + run: flutter config --no-analytics + + - name: Publish dry run + run: dart pub publish --dry-run + + - name: Flutter test + run: flutter test + publish: name: Pub publish + needs: verify permissions: id-token: write uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 diff --git a/.github/workflows/pub_publish_dry_run.yml b/.github/workflows/pub_publish_dry_run.yml index ba095f7..58ac4b6 100644 --- a/.github/workflows/pub_publish_dry_run.yml +++ b/.github/workflows/pub_publish_dry_run.yml @@ -23,8 +23,8 @@ jobs: - name: Disable analytics run: flutter config --no-analytics - - name: Flutter pub get - run: flutter pub get - - name: Publish dry run run: dart pub publish --dry-run + + - name: Flutter test + run: flutter test From bde515ca1cb2a041039b37ea5e415d4cbe54cea1 Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Fri, 18 Sep 2026 14:06:48 +0400 Subject: [PATCH 18/26] Correct publishing permissions and tag matching --- .github/workflows/pub_publish.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pub_publish.yml b/.github/workflows/pub_publish.yml index fab7807..5cd2bdd 100644 --- a/.github/workflows/pub_publish.yml +++ b/.github/workflows/pub_publish.yml @@ -3,7 +3,7 @@ name: Pub publish on: push: tags: - - '[0-9]+.[0-9]+.[0-9]+*' + - '[0-9]*.[0-9]*.[0-9]*' jobs: verify: @@ -32,5 +32,6 @@ jobs: name: Pub publish needs: verify permissions: + contents: read id-token: write uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 From 9b7eb93815a351307acd7c5f78f8cc196e3dc6e3 Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Thu, 24 Sep 2026 20:51:00 +0400 Subject: [PATCH 19/26] Use the documented release tag pattern --- .github/workflows/pub_publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pub_publish.yml b/.github/workflows/pub_publish.yml index 5cd2bdd..3b0aea4 100644 --- a/.github/workflows/pub_publish.yml +++ b/.github/workflows/pub_publish.yml @@ -3,7 +3,7 @@ name: Pub publish on: push: tags: - - '[0-9]*.[0-9]*.[0-9]*' + - '[0-9]+.[0-9]+.[0-9]+' jobs: verify: From 547ac69bc9a7f34d16fcabece396ce002b51078c Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Fri, 25 Sep 2026 04:15:45 +0400 Subject: [PATCH 20/26] Use the configured Dart formatter width --- .github/workflows/flutter_checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flutter_checks.yml b/.github/workflows/flutter_checks.yml index a53a189..1f11d61 100644 --- a/.github/workflows/flutter_checks.yml +++ b/.github/workflows/flutter_checks.yml @@ -49,7 +49,7 @@ jobs: run: flutter pub get - name: Check Dart formatting - run: dart format --page-width 120 --set-exit-if-changed . + run: dart format --set-exit-if-changed . analyze: name: Dart analyze From aedc4abdbdbead8afc5aaa2396109eceb47e78c0 Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Fri, 25 Sep 2026 09:35:18 +0400 Subject: [PATCH 21/26] Run CI on branches and filter Android integration tests --- .github/workflows/flutter_build_example.yml | 2 +- .github/workflows/flutter_checks.yml | 2 +- .../workflows/integration_tests_android.yml | 28 ++++++++++++++++++- .github/workflows/pub_publish_dry_run.yml | 3 +- .github/workflows/pub_score.yml | 2 +- 5 files changed, 32 insertions(+), 5 deletions(-) diff --git a/.github/workflows/flutter_build_example.yml b/.github/workflows/flutter_build_example.yml index be5c1c2..3f9eff0 100644 --- a/.github/workflows/flutter_build_example.yml +++ b/.github/workflows/flutter_build_example.yml @@ -5,7 +5,7 @@ on: pull_request: push: branches: - - main + - '**' jobs: build_android: diff --git a/.github/workflows/flutter_checks.yml b/.github/workflows/flutter_checks.yml index a53a189..d389ee4 100644 --- a/.github/workflows/flutter_checks.yml +++ b/.github/workflows/flutter_checks.yml @@ -5,7 +5,7 @@ on: pull_request: push: branches: - - main + - '**' jobs: check_pub_dependencies: diff --git a/.github/workflows/integration_tests_android.yml b/.github/workflows/integration_tests_android.yml index cb35b2c..618906f 100644 --- a/.github/workflows/integration_tests_android.yml +++ b/.github/workflows/integration_tests_android.yml @@ -3,9 +3,35 @@ name: Integration Tests (Android) on: workflow_dispatch: pull_request: + paths-ignore: + - '**.md' + - 'LICENSE' + - '.github/dependabot.yml' + - '.github/workflows/flutter_build_example.yml' + - '.github/workflows/flutter_checks.yml' + - '.github/workflows/pub_publish.yml' + - '.github/workflows/pub_publish_dry_run.yml' + - '.github/workflows/pub_score.yml' + - 'analysis_options.yaml' + - 'test/**' + - 'example/analysis_options.yaml' + - 'example/test/**' push: branches: - - main + - '**' + paths-ignore: + - '**.md' + - 'LICENSE' + - '.github/dependabot.yml' + - '.github/workflows/flutter_build_example.yml' + - '.github/workflows/flutter_checks.yml' + - '.github/workflows/pub_publish.yml' + - '.github/workflows/pub_publish_dry_run.yml' + - '.github/workflows/pub_score.yml' + - 'analysis_options.yaml' + - 'test/**' + - 'example/analysis_options.yaml' + - 'example/test/**' concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/.github/workflows/pub_publish_dry_run.yml b/.github/workflows/pub_publish_dry_run.yml index fd2dff7..2c9e442 100644 --- a/.github/workflows/pub_publish_dry_run.yml +++ b/.github/workflows/pub_publish_dry_run.yml @@ -2,9 +2,10 @@ name: Pub publish dry run on: workflow_dispatch: + pull_request: push: branches: - - main + - '**' jobs: publish-dry-run: diff --git a/.github/workflows/pub_score.yml b/.github/workflows/pub_score.yml index 7a2005d..fcf99c0 100644 --- a/.github/workflows/pub_score.yml +++ b/.github/workflows/pub_score.yml @@ -5,7 +5,7 @@ on: pull_request: push: branches: - - main + - '**' jobs: check-score: From 7766da5ebaa8fa7d2adaff7388d3669ad218cb9a Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Fri, 25 Sep 2026 10:27:35 +0400 Subject: [PATCH 22/26] Preserve every Android integration run --- .github/workflows/integration_tests_android.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/integration_tests_android.yml b/.github/workflows/integration_tests_android.yml index 618906f..931beda 100644 --- a/.github/workflows/integration_tests_android.yml +++ b/.github/workflows/integration_tests_android.yml @@ -33,10 +33,6 @@ on: - 'example/analysis_options.yaml' - 'example/test/**' -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - jobs: integration_test: name: Android API ${{ matrix.api-level }} - ${{ matrix.profile }} From ec092546cd1bf6a3eb58c1677dda020e17d01f7c Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Fri, 25 Sep 2026 12:07:37 +0400 Subject: [PATCH 23/26] Document the Kotlin runtime pin --- example/android/settings.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/example/android/settings.gradle b/example/android/settings.gradle index 3c6782b..8362c7a 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -19,6 +19,7 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "com.android.application" version "9.2.1" apply false + // Pin a Flutter-compatible Kotlin runtime without applying the legacy plugin. id "org.jetbrains.kotlin.android" version "2.4.20" apply false } From d22a2529b28c2184880e49415778da6d3be7364b Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Fri, 25 Sep 2026 16:47:33 +0400 Subject: [PATCH 24/26] Run Dependabot updates weekly --- .github/dependabot.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2f95e01..33e5046 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,23 +8,14 @@ updates: - package-ecosystem: "github-actions" directory: "/" schedule: - interval: "daily" - ignore: - - dependency-name: "*" - update-types: ["version-update:semver-minor", "version-update:semver-patch"] + interval: "weekly" - package-ecosystem: "pub" directory: "/" schedule: - interval: "daily" - ignore: - - dependency-name: "*" - update-types: ["version-update:semver-minor", "version-update:semver-patch"] + interval: "weekly" - package-ecosystem: "pub" directory: "example" schedule: - interval: "daily" - ignore: - - dependency-name: "*" - update-types: ["version-update:semver-minor", "version-update:semver-patch"] + interval: "weekly" From ac5359da57d70aafc6f3a8be05073cb6b5bbf87e Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Fri, 25 Sep 2026 17:07:22 +0400 Subject: [PATCH 25/26] Use canonical Dependabot example paths --- .github/dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 33e5046..4527c37 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -16,6 +16,6 @@ updates: interval: "weekly" - package-ecosystem: "pub" - directory: "example" + directory: "/example" schedule: interval: "weekly" From c3122ff077048abbf3c260a99604e887ac6837f8 Mon Sep 17 00:00:00 2001 From: Joachim Nohl <43643339+nohli@users.noreply.github.com> Date: Sat, 26 Sep 2026 00:45:22 +0400 Subject: [PATCH 26/26] Give Flutter jobs enough setup time --- .github/workflows/flutter_build_example.yml | 3 ++- .github/workflows/flutter_checks.yml | 15 ++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/flutter_build_example.yml b/.github/workflows/flutter_build_example.yml index 3f9eff0..7a2d969 100644 --- a/.github/workflows/flutter_build_example.yml +++ b/.github/workflows/flutter_build_example.yml @@ -11,7 +11,7 @@ jobs: build_android: name: Build example for Android runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 20 steps: - name: Checkout repository uses: actions/checkout@v7 @@ -35,6 +35,7 @@ jobs: run: flutter pub get - name: Flutter build appbundle + timeout-minutes: 10 run: | cd example flutter build appbundle --release diff --git a/.github/workflows/flutter_checks.yml b/.github/workflows/flutter_checks.yml index d389ee4..94cd7f1 100644 --- a/.github/workflows/flutter_checks.yml +++ b/.github/workflows/flutter_checks.yml @@ -10,7 +10,7 @@ on: jobs: check_pub_dependencies: name: Check dependencies - timeout-minutes: 10 + timeout-minutes: 20 runs-on: ubuntu-latest steps: - name: Checkout repository @@ -26,12 +26,13 @@ jobs: run: flutter config --no-analytics - name: Flutter pub get + timeout-minutes: 10 run: flutter pub get check_formatting: name: Check formatting runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 20 steps: - name: Checkout repository uses: actions/checkout@v7 @@ -49,11 +50,12 @@ jobs: run: flutter pub get - name: Check Dart formatting + timeout-minutes: 10 run: dart format --page-width 120 --set-exit-if-changed . analyze: name: Dart analyze - timeout-minutes: 10 + timeout-minutes: 20 runs-on: ubuntu-latest steps: - name: Checkout repository @@ -72,12 +74,13 @@ jobs: run: flutter pub get - name: Run Dart analyze + timeout-minutes: 10 uses: invertase/github-action-dart-analyzer@v3.0.0 test: name: Flutter test runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 20 steps: - name: Checkout repository uses: actions/checkout@v7 @@ -95,12 +98,13 @@ jobs: run: flutter pub get - name: Flutter test + timeout-minutes: 10 run: flutter test test_example: name: Flutter test example runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 20 steps: - name: Checkout repository uses: actions/checkout@v7 @@ -120,6 +124,7 @@ jobs: flutter pub get - name: Flutter test example + timeout-minutes: 10 run: | cd example flutter test