Skip to content

feat: support Flutter 3.50 and drop CocoaPods - #1115

Merged
Lyokone merged 8 commits into
masterfrom
chore/flutter-3.50
Nov 12, 2026
Merged

Lyokone merged 8 commits into
masterfrom
chore/flutter-3.50

Conversation

@Lyokone

@Lyokone Lyokone commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

CI uses channel: stable, which is now Flutter 3.50, and master fails two jobs on it:

  • Android: Gradle version (8.14.3) is lower than Flutter's minimum supported version of 9.3.1. 3.50 also rejects AGP < 9.1.1 and KGP < 2.4.10.
  • Analyzer: package:flutter/material.dart is deprecated, and the 8 infos in the example fail --fatal-infos.

Changes

Example app (not published)

  • Android: Gradle 9.5.0, AGP 9.3.1 and Java 17. The Kotlin Gradle plugin is gone, and android.builtInKotlin and android.newDsl are both true.
  • Imports moved to package:material_ui (dart fix --apply --code=migrate_design_widgets). The example now needs Flutter >= 3.47.
  • iOS/macOS use Swift Package Manager only: Podfiles, Pods xcconfig includes and Pods project references are removed.
  • The migrations 3.50 applies on build are committed: iOS 15.0 / macOS 12.0 deployment targets, macOS SwiftPM integration, and analyzer excludes.
  • web/index.html loads flutter_bootstrap.js instead of the deprecated service worker snippet.

location plugin (android/build.gradle)

  • ktlint-gradle 12.1.2 → 14.2.0. It is applied in every app's build, and only 13.1+ supports Gradle 9. The ktlint engine stays pinned at 1.0.1, so the style rules don't change.
  • Buildscript AGP/KGP 9.3.1 / 2.4.20 and Java/JVM target 17, matching the 3.50 plugin template. minSdk stays 21: 3.50 still builds apps with minSdk 23.

location drops CocoaPods (iOS/macOS)

  • darwin/location.podspec is removed, so the plugin ships as a Swift package only. SwiftPM has been on by default since Flutter 3.44, the plugin's minimum, and 3.50 warns whenever it's off. Apps that turned it off get Flutter's "only compatible with Swift Package Manager" error and must turn it back on. Other plugins can still use CocoaPods in the same app.
  • Add-to-app hosts should build with flutter build swift-package, because flutter build ios-framework/macos-framework only install plugins through CocoaPods.
  • The iOS/macOS install docs replace the Podfile deployment-target snippet with SwiftPM instructions. The CHANGELOG lists this under iOS & macOS for a minor release: only apps that turned SwiftPM off are affected, and Flutter already warns them.

CI

  • Web: flutter build web --wasm --no-deprecated-js-interop on every PR. The demo deploy adds --no-deprecated-js-interop.
  • Flutter 3.44 (minimum supported): analyzes and tests the published packages, then builds them into a fresh 3.44 app. The example is removed from that checkout because it needs Flutter 3.47 or later.

This also covers what #1108 set out to do.

Verification (local)

  • Flutter 3.50.0: analyze --fatal-infos, format and tests are clean. The Android, iOS simulator and macOS examples build.
  • The --wasm --no-deprecated-js-interop web build runs in a browser: the permission and service checks round-trip through location_web.
  • ktlintCheck passes. lintDebug shows the same 4 pre-existing errors; the extra warnings are newer dependency versions being available.
  • Flutter 3.44.6: a fresh app (AGP 9.0.1, builtInKotlin=false) that depends on the updated plugin builds an APK.
  • After removing the podspec, the iOS simulator and macOS examples still build on 3.50, with no warnings.
  • Not run locally: Windows/Linux. Those are left to CI.

Flutter 3.50 refuses to build with Gradle < 9.3.1, AGP < 9.1.1 or KGP
< 2.4.10. Move the example to the 3.50 template versions (Gradle 9.5.0,
AGP 9.3.1, Java 17) and drop the Kotlin Gradle plugin: MainActivity is
Java and the location plugin already compiles with Built-in Kotlin, so
android.builtInKotlin and android.newDsl can both be true.
package:flutter/material.dart is deprecated in Flutter 3.50, which fails
`flutter analyze --fatal-infos`. Applied with
`dart fix --apply --code=migrate_design_widgets`. material_ui needs
Flutter 3.47, so the example's floor moves there; the published packages
don't use Material and are unaffected.
Every plugin the example uses is a Swift package, so remove its CocoaPods
integration (Podfiles, Pods xcconfig includes and project references),
as Flutter 3.50 recommends. Commit the migrations 3.50 applies on build:
iOS 15.0 / macOS 12.0 deployment targets, SwiftPM integration for the
macOS runner, and analyzer excludes for build and platform directories.

Load the web example through flutter_bootstrap.js instead of the
deprecated service worker snippet, so `--wasm` builds can pick Wasm.
ktlint-gradle is applied in every app's build, and only 13.1+ supports
Gradle 9 (which Flutter 3.50 requires). Pin its ktlint engine to 1.0.1,
the version 12.1.2 bundled, so the rules don't change. Align the
buildscript AGP/KGP versions and the Java/JVM target (17) with Flutter
3.50's plugin template.
- iOS (CocoaPods): builds the example with SwiftPM disabled so the
  podspec keeps working now that the example is SwiftPM-only.
- Web: builds with --wasm --no-deprecated-js-interop on every PR; the
  demo deploy uses the interop flag too.
- Flutter 3.44: analyzes and tests the published packages and builds
  them into a fresh 3.44 app, so a floating `stable` can't hide a
  break in the declared minimum.
- iOS (CocoaPods): the example's Xcode project references the plugin as a
  Swift package, which can't resolve with SwiftPM off. Build a new
  CocoaPods app that depends on the plugin instead, and check that the
  pod was installed.
- Flutter 3.44: `flutter pub get` in packages/location also resolves the
  example, which needs Flutter 3.47+. Remove the example from that job's
  checkout.
@Lyokone Lyokone changed the title chore: support Flutter 3.50 feat!: support Flutter 3.50 and drop CocoaPods Nov 12, 2026
@Lyokone Lyokone changed the title feat!: support Flutter 3.50 and drop CocoaPods feat: support Flutter 3.50 and drop CocoaPods Nov 12, 2026
Remove the CocoaPods podspec. Swift Package Manager has been on by
default since Flutter 3.44 (the plugin's minimum), Flutter 3.50 warns
whenever it is off, and the CocoaPods trunk goes read-only in December
2026. Apps that turned SwiftPM off get Flutter's "only compatible with
Swift Package Manager" error and need to turn it back on; other plugins
can still use CocoaPods in the same app. Add-to-app hosts should use
`flutter build swift-package`, since `flutter build ios-framework` and
`macos-framework` only install plugins through CocoaPods.

Remove the CocoaPods CI job, and replace the Podfile-based
deployment-target section of the iOS/macOS install docs with SwiftPM
instructions.
@Lyokone
Lyokone merged commit 7230da7 into master Nov 12, 2026
8 checks passed
@Lyokone
Lyokone deleted the chore/flutter-3.50 branch November 12, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant