diff --git a/.github/workflows/flutter_ci.yml b/.github/workflows/flutter_ci.yml index bec525886..df2a50f19 100644 --- a/.github/workflows/flutter_ci.yml +++ b/.github/workflows/flutter_ci.yml @@ -41,7 +41,7 @@ jobs: strategy: fail-fast: false matrix: - sdk: [ '3.10.5', '' ] + sdk: [ '3.22.0', '' ] steps: - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 @@ -72,7 +72,7 @@ jobs: strategy: fail-fast: false matrix: - sdk: [ '3.10.5', '' ] + sdk: [ '3.22.0', '' ] steps: - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 @@ -101,7 +101,7 @@ jobs: strategy: fail-fast: false matrix: - sdk: [ '3.10.5', '' ] + sdk: [ '3.22.0', '' ] steps: - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 diff --git a/example/android/.gitignore b/example/android/.gitignore index 6f568019d..c232b0870 100644 --- a/example/android/.gitignore +++ b/example/android/.gitignore @@ -5,7 +5,7 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java - +/app/.cxx/ # Remember to never publicly share your keystore. # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app key.properties diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index f6d70ba42..50ba88acb 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) { } } -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' @@ -21,14 +22,10 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { namespace "org.maplibre.example" compileSdkVersion 34 - ndkVersion "26.1.10909125" + ndkVersion "27.0.12077973" compileOptions { sourceCompatibility JavaVersion.VERSION_17 diff --git a/example/android/build.gradle b/example/android/build.gradle index 1f2593124..1e73c4ff6 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,15 +1,3 @@ -buildscript { - ext.kotlin_version = '1.9.0' - repositories { - google() - mavenCentral() - } - - dependencies { - classpath 'com.android.tools.build:gradle:8.2.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} allprojects { repositories { diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index dc159ecf5..3e12486f1 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Wed Feb 19 16:20:21 ICT 2025 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip diff --git a/example/android/settings.gradle b/example/android/settings.gradle index 44e62bcf0..7089cff0e 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -1,11 +1,25 @@ -include ':app' +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.2.2" apply false + id "org.jetbrains.kotlin.android" version "2.0.20" apply false +} + +include ":app" \ No newline at end of file diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 907af722e..e86cc23cf 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -6,8 +6,8 @@ repository: https://github.com/maplibre/flutter-maplibre-gl issue_tracker: https://github.com/maplibre/flutter-maplibre-gl/issues environment: - sdk: '>=3.0.0 <4.0.0' - flutter: '>=3.10.0' + sdk: '>=3.4.0 <4.0.0' + flutter: '>=3.22.0' dependencies: collection: ^1.17.1 @@ -17,7 +17,7 @@ dependencies: http: ^1.1.0 location: ^5.0.3 maplibre_gl: ^0.20.0 - path_provider: ^2.0.15 + path_provider: ^2.1.5 dev_dependencies: flutter_test: diff --git a/maplibre_gl/android/src/main/java/org/maplibre/maplibregl/GlobalMethodHandler.java b/maplibre_gl/android/src/main/java/org/maplibre/maplibregl/GlobalMethodHandler.java index a94b7cf5b..edb8d2ee2 100644 --- a/maplibre_gl/android/src/main/java/org/maplibre/maplibregl/GlobalMethodHandler.java +++ b/maplibre_gl/android/src/main/java/org/maplibre/maplibregl/GlobalMethodHandler.java @@ -26,15 +26,9 @@ class GlobalMethodHandler implements MethodChannel.MethodCallHandler { private static final int BUFFER_SIZE = 1024 * 2; @NonNull private final Context context; @NonNull private final BinaryMessenger messenger; - @Nullable private PluginRegistry.Registrar registrar; @Nullable private FlutterPlugin.FlutterAssets flutterAssets; @Nullable private OfflineChannelHandlerImpl downloadOfflineRegionChannelHandler; - GlobalMethodHandler(@NonNull PluginRegistry.Registrar registrar) { - this.registrar = registrar; - this.context = registrar.activeContext(); - this.messenger = registrar.messenger(); - } GlobalMethodHandler(@NonNull FlutterPlugin.FlutterPluginBinding binding) { this.context = binding.getApplicationContext(); @@ -152,9 +146,7 @@ private InputStream openTilesDbFile(String tilesDb) throws IOException { return new FileInputStream(new File(tilesDb)); } else { String assetKey; - if (registrar != null) { - assetKey = registrar.lookupKeyForAsset(tilesDb); - } else if (flutterAssets != null) { + if (flutterAssets != null) { assetKey = flutterAssets.getAssetFilePathByName(tilesDb); } else { throw new IllegalStateException(); diff --git a/maplibre_gl/lib/src/color_tools.dart b/maplibre_gl/lib/src/color_tools.dart index d0ac9c1cc..6710d7b9d 100644 --- a/maplibre_gl/lib/src/color_tools.dart +++ b/maplibre_gl/lib/src/color_tools.dart @@ -1,3 +1,5 @@ +// ignore_for_file: deprecated_member_use + part of '../maplibre_gl.dart'; extension MapLibreColorConversion on Color { diff --git a/maplibre_gl/pubspec.yaml b/maplibre_gl/pubspec.yaml index c1d1a0634..36f965567 100644 --- a/maplibre_gl/pubspec.yaml +++ b/maplibre_gl/pubspec.yaml @@ -5,8 +5,8 @@ repository: https://github.com/maplibre/flutter-maplibre-gl issue_tracker: https://github.com/maplibre/flutter-maplibre-gl/issues environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: '>=3.4.0 <4.0.0' + flutter: '>=3.22.0' dependencies: flutter: diff --git a/maplibre_gl_platform_interface/pubspec.yaml b/maplibre_gl_platform_interface/pubspec.yaml index e2b3c4444..148c9f8fc 100644 --- a/maplibre_gl_platform_interface/pubspec.yaml +++ b/maplibre_gl_platform_interface/pubspec.yaml @@ -5,8 +5,8 @@ repository: https://github.com/maplibre/flutter-maplibre-gl issue_tracker: https://github.com/maplibre/flutter-maplibre-gl/issues environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: '>=3.4.0 <4.0.0' + flutter: '>=3.22.0' dependencies: flutter: diff --git a/maplibre_gl_web/analysis_options.yaml b/maplibre_gl_web/analysis_options.yaml index 0caccc81e..e4e21a077 100644 --- a/maplibre_gl_web/analysis_options.yaml +++ b/maplibre_gl_web/analysis_options.yaml @@ -1 +1,6 @@ -include: ../analysis_options.yaml \ No newline at end of file +include: ../analysis_options.yaml + +analyzer: + errors: + deprecated_member_use: ignore + deprecated_member_use_from_same_package: ignore \ No newline at end of file diff --git a/maplibre_gl_web/pubspec.yaml b/maplibre_gl_web/pubspec.yaml index 1c72fbee1..bb778b08f 100644 --- a/maplibre_gl_web/pubspec.yaml +++ b/maplibre_gl_web/pubspec.yaml @@ -5,8 +5,8 @@ repository: https://github.com/maplibre/flutter-maplibre-gl issue_tracker: https://github.com/maplibre/flutter-maplibre-gl/issues environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" + sdk: '>=3.4.0 <4.0.0' + flutter: '>=3.22.0' flutter: plugin: