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 3.7 support #1270

Closed
bdezso opened this issue Jan 25, 2023 · 14 comments
Closed

Flutter 3.7 support #1270

bdezso opened this issue Jan 25, 2023 · 14 comments
Labels

Comments

@bdezso
Copy link

bdezso commented Jan 25, 2023

The current released build can't compile with Flutter 3.7

Could not build the precompiled application for the device.
Error (Xcode):
../../../../.pub-cache/git/flutter-mapbox-gl-f505fcf5c79b75c165703028af77f3af62d382ae/mapbox_gl_platform_interface/lib/src/view_wrappers.dart:29:7:
Error: The non-abstract class 'TextureAndroidViewControllerWrapper' is missing implementations for these members:

@edufolly
Copy link
Contributor

Open a PR to fix it. #1273

@edufolly
Copy link
Contributor

Maybe you can use my fork from dev branch.

  mapbox_gl:
    git:
      url: https://github.com/edufolly/maps
      ref: dev

@bdezso
Copy link
Author

bdezso commented Jan 28, 2023

Thanks, I will.

@adhityapaf
Copy link

adhityapaf commented Feb 1, 2023

I had a fatal signal error if myLocation is set to true after clicking the button to navigate to the page with Mapbox widget inside when using your fork @edufolly, it shows this error:

signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
Abort message: 'terminating with uncaught exception of type jni::PendingJavaException'
    x0  0000000000000000  x1  00000000000043b5  x2  0000000000000006  x3  0000007ff7689390
    x4  736f646277641f73  x5  736f646277641f73  x6  736f646277641f73  x7  7f7f7f7f7f7f7f7f
    x8  00000000000000f0  x9  000000765eb32a00  x10 0000000000000001  x11 000000765eb70de4
    x12 0000007670457020  x13 000000007fffffff  x14 00000000004a8420  x15 00000068a126d6b6
    x16 000000765ebd5d58  x17 000000765ebb2c70  x18 000000766f72e000  x19 00000000000043b5
    x20 00000000000043b5  x21 00000000ffffffff  x22 ffffff80ffffffc8  x23 0000007ff76895e0
    x24 0000007ff76894c0  x25 0000007ff7689500  x26 00000071a293d968  x27 00000071a293d960
    x28 00000071a293d980  x29 0000007ff7689410
    lr  000000765eb62968  sp  0000007ff7689370  pc  000000765eb62994  pst 0000000000001000

@sumityadu07
Copy link

Yes this issue occurs when myLocationEnabled = true
As I have researched it says another location is running and both services have distinct Goolge Play Services location service version

@sumityadu07
Copy link

sumityadu07 commented Feb 13, 2023

In my condition no map was showing and app was crashing when I set myLocationEnabled = true.
Later I had to remove it and I set InitialCameraPosition to const for the map to work.

@liangzaifankun
Copy link

I also encountered this problem. Is there a good solution now

@sdabet-orpheo
Copy link

I had a similar problem in my project, which was caused by a Play Services conflict between geolocator and mapbox_gl. I fixed it by downgrading geolocator_android to version 4.1.4 in pubspec.lock.

@SkilyFrance
Copy link

@sdabet-orpheo You can keep myLocationEnabled on true with your configuration without getting a crash ?
I'm looking for a solution to run correctly this package on Android with myLocationEnabled on true and Flutter 3.7.1

@sdabet-orpheo
Copy link

Yes, it worked on my project.

@mapacheverdugo
Copy link

I had a similar problem in my project, which was caused by a Play Services conflict between geolocator and mapbox_gl. I fixed it by downgrading geolocator_android to version 4.1.4 in pubspec.lock.

I'm not using geolocator in my project, so that didn't work for me, but PR #1293 did, just use the GitHub link in pubspec.yaml until a new release of this library comes out

  mapbox_gl:
    git:
      url: https://github.com/flutter-mapbox-gl/maps
      ref: 9eef30d # or master

@MapleNoise
Copy link

MapleNoise commented May 23, 2023

  • I downgraded Flutter to 3.3.10
  • I changed my pubspec.yaml to
mapbox_gl:
    git:
      url: https://github.com/flutter-mapbox-gl/maps
      ref: 9eef30d # or master
  • I added to my build.gradle specified here and here
configurations.all {
            resolutionStrategy {
                force "com.google.android.gms:play-services-location:21.0.1"
            }
        }
  • I changed my geolocator_android to 4.1.4

And crash continue when set myLocationEnabled = true

This error appear before crash :

E/AndroidRuntime( 4709): java.lang.IncompatibleClassChangeError: Found interface com.google.android.gms.location.FusedLocationProviderClient, but class was expected (declaration of 'com.google.android.gms.location.FusedLocationProviderClient' appears in /data/app/com.mile.citygem-gu0JDgqQZuZ37YfPQ82b1w==/base.apk!classes6.dex)
E/AndroidRuntime( 4709): 	at com.mapbox.android.core.location.GoogleLocationEngineImpl.requestLocationUpdates(GoogleLocationEngineImpl.java:58)
E/AndroidRuntime( 4709): 	at com.mapbox.android.core.location.GoogleLocationEngineImpl.requestLocationUpdates(GoogleLocationEngineImpl.java:26)
E/AndroidRuntime( 4709): 	at com.mapbox.android.core.location.LocationEngineProxy.requestLocationUpdates(LocationEngineProxy.java:34)
E/AndroidRuntime( 4709): 	at com.mapbox.mapboxsdk.location.LocationComponent.onLocationLayerStart(LocationComponent.java:1439)
E/AndroidRuntime( 4709): 	at com.mapbox.mapboxsdk.location.LocationComponent.enableLocationComponent(LocationComponent.java:1568)
E/AndroidRuntime( 4709): 	at com.mapbox.mapboxsdk.location.LocationComponent.setLocationComponentEnabled(LocationComponent.java:551)
E/AndroidRuntime( 4709): 	at com.mapbox.mapboxgl.MapboxMapController.enableLocationComponent(MapboxMapController.java:277)
E/AndroidRuntime( 4709): 	at com.mapbox.mapboxgl.MapboxMapController.updateMyLocationEnabled(MapboxMapController.java:1782)
E/AndroidRuntime( 4709): 	at com.mapbox.mapboxgl.MapboxMapController.setMyLocationEnabled(MapboxMapController.java:1670)
E/AndroidRuntime( 4709): 	at com.mapbox.mapboxgl.Convert.interpretMapboxMapOptions(Convert.java:253)
E/AndroidRuntime( 4709): 	at com.mapbox.mapboxgl.MapboxMapController.onMethodCall(MapboxMapController.java:670)
E/AndroidRuntime( 4709): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
E/AndroidRuntime( 4709): 	at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/AndroidRuntime( 4709): 	at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/AndroidRuntime( 4709): 	at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/AndroidRuntime( 4709): 	at android.os.Handler.handleCallback(Handler.java:873)
E/AndroidRuntime( 4709): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 4709): 	at android.os.Looper.loop(Looper.java:214)
E/AndroidRuntime( 4709): 	at android.app.ActivityThread.main(ActivityThread.java:7073)
E/AndroidRuntime( 4709): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 4709): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
E/AndroidRuntime( 4709): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)

So I only changed my geolocator version to 8.2.1 because problem can be from com.google.android.gms:play-services-location:21.0.0 mentionned here

And work fine !

@stale
Copy link

stale bot commented Jul 22, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 22, 2023
@felix-ht
Copy link
Collaborator

fixed on master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants