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

Mapbox is not working after migrating to null safety flutter_mapbox_navigation@0.0.26 #145

Closed
moolsbytheway opened this issue Sep 19, 2021 · 28 comments

Comments

@moolsbytheway
Copy link

moolsbytheway commented Sep 19, 2021

Hello eopeter,
Let me fist think you for making this amazing project.
And let you know that any comment or guiding that you provide will be helpful in my case (because i have an app in beta testing blocked by this issue)

Recently i migrated my project to Null Safety and it was dependent on flutter_mapbox_navigation version 0.0.19

So i needed to migrate to the Null Safety version of the package which i assume is 0.0.26

The navigation view doesn't work anymore, nor the map view.

I thought it's maybe something wrong with my project so i cloned yours and tried to start the example provided as is (i just changed the mapbox tokens)

These screenshots are from your project's example (same issue in mine also)

The navigation view is like this:
image

And these two exceptions shows up
image

I noticed something strange in this class,
i started a debug session and sometimes the object json doesn't have the structure you are waiting for eventType and data fields are missing and the structure looks like RouteProgressEvent class.

Something else, your model is different from the model provided in the 1.2.0 navigation ui api
https://docs.mapbox.com/android/navigation/api/1.2.0/libnavigation-base/-base/com.mapbox.navigation.base.trip.model/-route-progress/

image

Any help will be appreciated.

Thank you.

@ShejaEddy
Copy link

In my case it can't even open once on android, It crashes as soon as the page is opened

I/huribus.map_bo( 9854): Background concurrent copying GC freed 15252(1113KB) AllocSpace objects, 4(208KB) LOS objects, 49% free, 3MB/6MB, paused 5.277ms total 119.614ms
E/MapboxNavNative( 9854): User defined HTTP service instance not provided from the module implementation.
E/MapboxNavNative( 9854): Module: com.mapbox.common.module.okhttp.MapboxOkHttpService@d96dfde
E/MapboxNavNative( 9854): but present is: com.mapbox.common.module.okhttp.MapboxOkHttpService@d96dfde
E/MapboxNavNative( 9854): Are you calling HttpServiceFactory.setUserDefined() correctly?
E/AndroidRuntime( 9854): FATAL EXCEPTION: main
E/AndroidRuntime( 9854): Process: com.shuribus.map_box, PID: 9854
E/AndroidRuntime( 9854): java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZN6mapbox6common14OfflineService16registerObserverERKNSt6__ndk110shared_ptrINS0_22OfflineServiceObserverEEE" referenced by "/data/app/com.shuribus.map_box-vWwa6rDZFuIZiRC2JiqDyA==/lib/arm/libnavigator-android.so"...
E/AndroidRuntime( 9854):        at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
E/AndroidRuntime( 9854):        at java.lang.System.loadLibrary(System.java:1669)
E/AndroidRuntime( 9854):        at com.mapbox.navigator.NavNativeStaticInitializer$Companion.loadRequiredDependencies(NavNativeStaticInitializer.kt:45)
E/AndroidRuntime( 9854):        at com.mapbox.navigator.NavNativeStaticInitializer.loadRequiredDependencies(Unknown Source:2)
E/AndroidRuntime( 9854):        at com.mapbox.navigator.Navigator.<clinit>(Navigator.java:13)
E/AndroidRuntime( 9854):        at com.mapbox.navigation.navigator.internal.NavigatorLoader.createNavigator(NavigatorLoader.kt:24)
E/AndroidRuntime( 9854):        at com.mapbox.navigation.navigator.internal.MapboxNativeNavigatorImpl.create(MapboxNativeNavigatorImpl.kt:59)
E/AndroidRuntime( 9854):        at com.mapbox.navigation.core.NavigationComponentProvider.createNativeNavigator(NavigationComponentProvider.kt:31)
E/AndroidRuntime( 9854):        at com.mapbox.navigation.core.MapboxNavigation.<init>(MapboxNavigation.kt:168)
E/AndroidRuntime( 9854):        at com.mapbox.navigation.core.MapboxNavigationProvider.create(MapboxNavigationProvider.kt:23)
E/AndroidRuntime( 9854):        at com.dormmom.flutter_mapbox_navigation.factory.FlutterMapViewFactory.<init>(FlutterMapViewFactory.kt:174)
E/AndroidRuntime( 9854):        at com.dormmom.flutter_mapbox_navigation.factory.MapViewFactory.create(MapViewFactory.kt:17)
E/AndroidRuntime( 9854):        at io.flutter.plugin.platform.SingleViewPresentation.onCreate(SingleViewPresentation.java:186)
E/AndroidRuntime( 9854):        at android.app.Dialog.dispatchOnCreate(Dialog.java:407)
E/AndroidRuntime( 9854):        at android.app.Dialog.show(Dialog.java:302)
E/AndroidRuntime( 9854):        at android.app.Presentation.show(Presentation.java:249)
E/AndroidRuntime( 9854):        at io.flutter.plugin.platform.VirtualDisplayController.<init>(VirtualDisplayController.java:95)
E/AndroidRuntime( 9854):        at io.flutter.plugin.platform.VirtualDisplayController.create(VirtualDisplayController.java:48)
E/AndroidRuntime( 9854):        at io.flutter.plugin.platform.PlatformViewsController$1.createVirtualDisplayForPlatformView(PlatformViewsController.java:207)
E/AndroidRuntime( 9854):        at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:104)
E/AndroidRuntime( 9854):        at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59)
E/AndroidRuntime( 9854):        at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/AndroidRuntime( 9854):        at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/AndroidRuntime( 9854):        at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
E/AndroidRuntime( 9854):        at android.os.MessageQueue.nativePollOnce(Native Method)
E/AndroidRuntime( 9854):        at android.os.MessageQueue.next(MessageQueue.java:326)
E/AndroidRuntime( 9854):        at android.os.Looper.loop(Looper.java:160)
E/AndroidRuntime( 9854):        at android.app.ActivityThread.main(ActivityThread.java:6724)
E/AndroidRuntime( 9854):        at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 9854):        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/AndroidRuntime( 9854):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:911)

@eopeter
Copy link
Owner

eopeter commented Sep 20, 2021 via email

@ShejaEddy
Copy link

Yes I did.

org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
MAPBOX_DOWNLOADS_TOKEN=sk.eyJ1Ijoic2hlamFlZGR5MDUiLCJhIjoiY2t0cmlobzFyMGw3MzJ2a2dkczAxZnp0aSJ9.xwM1tgpoPiP3RN7UIrMuHg

@moolsbytheway
Copy link
Author

@eopeter same here

@ShejaEddy
Copy link

I managed to get my app started, Wow! It feels really good.
Now I'm facing the same issue as @moolsbytheway [
image
]

@moolsbytheway
Copy link
Author

@eopeter any idea ? any actions that i can take to resolve this ? (beside re-implementing eveything with the last version of navigation-ui )

@ShejaEddy
Copy link

ShejaEddy commented Sep 21, 2021

I think I @moolsbytheway is right, the problem is originating here at this Function

RouteEvent _parseRouteEvent(String jsonString) {
    RouteEvent event;
    var map = json.decode(jsonString); // The response is varying differently to the expected model response (EventType &  data: which is sometimes missing from the response
    var progressEvent = RouteProgressEvent.fromJson(map); // The response model has changed, This model won't work anymore.
    if (progressEvent.isProgressEvent!) {
      event = RouteEvent(
          eventType: MapBoxEvent.progress_change, data: progressEvent);
    } else
      event = RouteEvent.fromJson(map);
    return event;
  }

I don't think I can be of much help but this is the cause of the problem. Please @eopeter help us. @moolsbytheway Have you found a workaround?

@elFallino
Copy link

elFallino commented Sep 24, 2021

I have the same repeating warning:
W/Mbgl (10182): {Worker 2}[Style]: Attempt to set an invalid property value -0.041080)

I've seen this before. This is the alpha-value of the LocationComponent pulse (that "own location"- marker on the map).
It has that pulsing circle around that is fading out. The value for alpha is calculated to a value lower then 0 that is invalid for the alpha value. You can "see" it as the pulse is fully visible for a moment before the pulsing repeats.

This issue is mentioned here:
mapbox/mapbox-gl-native-android#611
mapbox/mapbox-gl-native-android#625

I guess using the latest mapbox libraries should fix that as well as disabling that pulse.

Edit: this can be fixed by yourself. You can set a current version of com.mapbox.navigation:ui in the build.gradle file for the android part of this plugin.
The iOS part should be changed as well.

@ShejaEddy
Copy link

Please @elFallino can you show how to do that. An example would be nice.

@BrianRigii
Copy link

BrianRigii commented Nov 15, 2021

Please @elFallino can you show how to do that. An example would be nice.

Hey @elFallino kindly assist

@aramisromero89
Copy link

In my case it can't even open once on android, It crashes as soon as the page is opened

I/huribus.map_bo( 9854): Background concurrent copying GC freed 15252(1113KB) AllocSpace objects, 4(208KB) LOS objects, 49% free, 3MB/6MB, paused 5.277ms total 119.614ms
E/MapboxNavNative( 9854): User defined HTTP service instance not provided from the module implementation.
E/MapboxNavNative( 9854): Module: com.mapbox.common.module.okhttp.MapboxOkHttpService@d96dfde
E/MapboxNavNative( 9854): but present is: com.mapbox.common.module.okhttp.MapboxOkHttpService@d96dfde
E/MapboxNavNative( 9854): Are you calling HttpServiceFactory.setUserDefined() correctly?
E/AndroidRuntime( 9854): FATAL EXCEPTION: main
E/AndroidRuntime( 9854): Process: com.shuribus.map_box, PID: 9854
E/AndroidRuntime( 9854): java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZN6mapbox6common14OfflineService16registerObserverERKNSt6__ndk110shared_ptrINS0_22OfflineServiceObserverEEE" referenced by "/data/app/com.shuribus.map_box-vWwa6rDZFuIZiRC2JiqDyA==/lib/arm/libnavigator-android.so"...
E/AndroidRuntime( 9854):        at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
E/AndroidRuntime( 9854):        at java.lang.System.loadLibrary(System.java:1669)
E/AndroidRuntime( 9854):        at com.mapbox.navigator.NavNativeStaticInitializer$Companion.loadRequiredDependencies(NavNativeStaticInitializer.kt:45)
E/AndroidRuntime( 9854):        at com.mapbox.navigator.NavNativeStaticInitializer.loadRequiredDependencies(Unknown Source:2)
E/AndroidRuntime( 9854):        at com.mapbox.navigator.Navigator.<clinit>(Navigator.java:13)
E/AndroidRuntime( 9854):        at com.mapbox.navigation.navigator.internal.NavigatorLoader.createNavigator(NavigatorLoader.kt:24)
E/AndroidRuntime( 9854):        at com.mapbox.navigation.navigator.internal.MapboxNativeNavigatorImpl.create(MapboxNativeNavigatorImpl.kt:59)
E/AndroidRuntime( 9854):        at com.mapbox.navigation.core.NavigationComponentProvider.createNativeNavigator(NavigationComponentProvider.kt:31)
E/AndroidRuntime( 9854):        at com.mapbox.navigation.core.MapboxNavigation.<init>(MapboxNavigation.kt:168)
E/AndroidRuntime( 9854):        at com.mapbox.navigation.core.MapboxNavigationProvider.create(MapboxNavigationProvider.kt:23)
E/AndroidRuntime( 9854):        at com.dormmom.flutter_mapbox_navigation.factory.FlutterMapViewFactory.<init>(FlutterMapViewFactory.kt:174)
E/AndroidRuntime( 9854):        at com.dormmom.flutter_mapbox_navigation.factory.MapViewFactory.create(MapViewFactory.kt:17)
E/AndroidRuntime( 9854):        at io.flutter.plugin.platform.SingleViewPresentation.onCreate(SingleViewPresentation.java:186)
E/AndroidRuntime( 9854):        at android.app.Dialog.dispatchOnCreate(Dialog.java:407)
E/AndroidRuntime( 9854):        at android.app.Dialog.show(Dialog.java:302)
E/AndroidRuntime( 9854):        at android.app.Presentation.show(Presentation.java:249)
E/AndroidRuntime( 9854):        at io.flutter.plugin.platform.VirtualDisplayController.<init>(VirtualDisplayController.java:95)
E/AndroidRuntime( 9854):        at io.flutter.plugin.platform.VirtualDisplayController.create(VirtualDisplayController.java:48)
E/AndroidRuntime( 9854):        at io.flutter.plugin.platform.PlatformViewsController$1.createVirtualDisplayForPlatformView(PlatformViewsController.java:207)
E/AndroidRuntime( 9854):        at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:104)
E/AndroidRuntime( 9854):        at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59)
E/AndroidRuntime( 9854):        at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/AndroidRuntime( 9854):        at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/AndroidRuntime( 9854):        at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
E/AndroidRuntime( 9854):        at android.os.MessageQueue.nativePollOnce(Native Method)
E/AndroidRuntime( 9854):        at android.os.MessageQueue.next(MessageQueue.java:326)
E/AndroidRuntime( 9854):        at android.os.Looper.loop(Looper.java:160)
E/AndroidRuntime( 9854):        at android.app.ActivityThread.main(ActivityThread.java:6724)
E/AndroidRuntime( 9854):        at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 9854):        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/AndroidRuntime( 9854):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:911)

@ShejaEddy how did you solve this?? I'm facing same issue.

@eopeter
Copy link
Owner

eopeter commented Nov 26, 2021 via email

@moolsbytheway
Copy link
Author

moolsbytheway commented Nov 26, 2021

@eopeter thank you, please drop a comment here when the upgrade is done.

@BrianRigii
Copy link

@eopeter where are we on this

@eopeter
Copy link
Owner

eopeter commented Dec 7, 2021 via email

@eopeter
Copy link
Owner

eopeter commented Dec 7, 2021 via email

@BrianRigii
Copy link

Greate, looking forward to it

@eopeter
Copy link
Owner

eopeter commented Dec 14, 2021

Will provide update on this soon...jammed

@moolsbytheway
Copy link
Author

@eopeter any news ?

@eopeter
Copy link
Owner

eopeter commented Dec 21, 2021

my vacation begins today so hoping to close this out. Experiencing a weird issue where the map tiles won't load when embedded. Hoping to get resolution on it today.

@moolsbytheway
Copy link
Author

Thank you so much for the effort, i appreciate it.

@DevPianist
Copy link

Waiting the update, thank you!

@MarkLinovy
Copy link

@eopeter Also waiting for the new version :)

I would love to assist you. But I wouldn't want to start a fork when you are just a few minutes short of releasing it. So I would appreciate an update on this Issue.

@moolsbytheway
Copy link
Author

@eopeter any news ? 😢

@eopeter
Copy link
Owner

eopeter commented Feb 12, 2022

This should be fixed in the latest. The library is migrated to MapBox Android 10 and once I deploy it, should address a lot of the open bugs

@moolsbytheway
Copy link
Author

Thank you for the reactivity.
Do you have any estimated release date 😭 ?

@otorresd
Copy link

Any news?

@eopeter
Copy link
Owner

eopeter commented Apr 26, 2023

the new update should resolve this issue

@eopeter eopeter closed this as completed Apr 26, 2023
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

9 participants