Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter web apps on iOS 18.2 have issues only fixed in the most recent flutter version 3.27.0 (which mapbox_gl is not able to compile to) #1430

Closed
TBA-Lucas opened this issue Dec 13, 2024 · 11 comments

Comments

@TBA-Lucas
Copy link

The most recent iOS 18.2 update introduced a big issue for Flutter web apps regarding fingure and scroll gestures. There seems to be a fix for that only in the most recent flutter version 3.27.0. Unfortunately it seems like an app using mapbox_gl is not able to compile to that version.

iOS 18.2 Related issues and pull requests:

flutter/flutter#158299
flutter/flutter#155987
flutter/engine#56719
flutter/engine#56949

It seems that on the way from 3.24 to 3.27 the flutter team introduced some breaking changes for mapbox_gl, I'm getting compile errors. They seem to be related to the method 'hashValues' causing errors in mapbox_gl_platform_interface.dart:

Error: The method 'hashValues' isn't defined for the class 'LatLng'.
 - 'LatLng' is from 'package:mapbox_gl_platform_interface/mapbox_gl_platform_interface.dart'
 
Error: The method 'hashValues' isn't defined for the class 'CameraPosition'.
 - 'CameraPosition' is from 'package:mapbox_gl_platform_interface/mapbox_gl_platform_interface.dart'
 
Error: The method 'hashValues' isn't defined for the class 'LatLngQuad'.
 - 'LatLngQuad' is from 'package:mapbox_gl_platform_interface/mapbox_gl_platform_interface.dart'
 
Error: The method 'hashValues' isn't defined for the class 'MinMaxZoomPreference'.
 - 'MinMaxZoomPreference' is from 'package:mapbox_gl_platform_interface/mapbox_gl_platform_interface.dart'

I know mapbox_gl hasn't seen a lot of activity recently, but it would be greatly appreciated if someone here is able to make mapbox_gl compile on the newest flutter version!

@felix-ht
Copy link
Collaborator

just looking at the error messages this seems like a minor issue. HashValues was deprecated in the most recent dart versions.

@irvine5k
Copy link
Contributor

I opened up a PR fixing it #1431

@skaftanis
Copy link

Does 3.27.0 really fix ios 18.2 issues?

@Shiba-Kar
Copy link

mapbox_gl:
    git:
      url: https://github.com/irvine5k/maps.git #https://github.com/flutter-mapbox-gl/maps.git
      ref: fix-hash-values

am i missing something ?
getting the same error

@TBA-Lucas
Copy link
Author

TBA-Lucas commented Dec 16, 2024

Same here, looking at the pubspec.lock file it seems it is still using the original mapbox_gl_platform_interface files instead of the changed ones:

  mapbox_gl:
    dependency: "direct main"
    description:
      path: "."
      ref: fix-hash-values
      resolved-ref: d5a0c9057653cb2d3bce90f56ab226432258552b
      url: "https://github.com/irvine5k/maps.git"
    source: git
    version: "0.16.0"
  mapbox_gl_platform_interface:
    dependency: transitive
    description:
      path: mapbox_gl_platform_interface
      ref: HEAD
      resolved-ref: b2bfef669e42397704b6f43d55b5df67b18c0fa8
      url: "https://github.com/tobrun/flutter-mapbox-gl.git"
    source: git
    version: "0.16.0"

(this was after deleting the .lock file and flutter clean, flutter pub cache clean)

@irvine5k
Copy link
Contributor

irvine5k commented Dec 16, 2024

@Shiba-Kar @TBA-Lucas, the underlining packages point to https://github.com/tobrun/flutter-mapbox-gl.git instead of my fork; I can't change it for the PR. It should be fixed once the PR is merged.

@irvine5k
Copy link
Contributor

I'd recommend you to fork my branch, and change the references of the following dependencies in pubspec.yaml and mapbox_gl_web/pubspec.yaml to something like:

dependencies:
  flutter:
    sdk: flutter
  mapbox_gl_platform_interface:
    git:
      url: https://github.com/irvine5k/maps.git
      path: mapbox_gl_platform_interface
  mapbox_gl_web:
    git:
      url: https://github.com/irvine5k/maps.git
      path: mapbox_gl_platform_interface

Then you can use the fork in your project while my fix (or their fix) isn't merged.

I'm sorry for not giving clear instructions earlier.

cc @TBA-Lucas @Shiba-Kar

@shibakar
Copy link

dependencies:
     mapbox_gl:
        git:
          url: https://github.com/flutter-mapbox-gl/maps.git   
dependency_overrides:
    mapbox_gl_platform_interface:
        git:
          url: https://github.com/irvine5k/maps.git
          ref: fix-hash-values
          path: mapbox_gl_platform_interface
      mapbox_gl_web:
        git:
          url: https://github.com/irvine5k/maps.git
          ref: fix-hash-values
          path: mapbox_gl_web  

This works for me .

@TBA-Lucas
Copy link
Author

TBA-Lucas commented Dec 18, 2024

Awesome, that works @shibakar! And thanks for the PR @irvine5k, upgrading worked, hope it gets merged soon :)

Edit: found an issue with animateCamera with the new version: #1431 (comment)

@felix-ht
Copy link
Collaborator

felix-ht commented Jan 10, 2025

merged sorry for the wait!

@TBA-Lucas
Copy link
Author

Thanks a lot @irvine5k and @felix-ht !

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

No branches or pull requests

6 participants