-
Notifications
You must be signed in to change notification settings - Fork 176
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
i have a driving app that use google_maps and mapbox navigation as a navigation map but my app crash when the mapbox navigation is called 3 times #269
Comments
Is this an embedded Nav view? Does the view Id and app Id match your app? |
i dont know what is view Id and app Id |
having similar issue yes this is an embedded nav view. The app id does matches the one with our id. no idea what is view id |
I don't know if you're using lib "Location" but it's crashing. |
I do actually use location lib as an alternative way to track user location |
Try https://pub.dev/packages/geolocator and replace the location lib |
I use both geo locator and locatin |
+1 |
but I also get this error only when using google_map. maybe the google_map package is causing this issue |
One of the approaches that i tried to make is to delete the mapbox navigation lib and see if the google map lib is the cause of the problem everything went alright and i didn't encounter any issues related |
@XxMenotoxX Did you remove the google map library and mapbox is working perfectly? |
Yes i did but i will try again on an empty project to see if i encounter the same issue |
@XxMenotoxX I am trying to remove google map library as well to check |
Same issue even when google maps are removed. It's a weird issue since it always happens at the 3rd time. |
same issue too , weird issue indeed @wbilalz400 |
The same thing happens to me in embedded view and always at the third time call. Also when I define mapStyleUrlNight: "mapbox://styles/mapbox/traffic-night-v2" and mapStyleUrlDay: "mapbox://styles/mapbox/traffic-day-v2" the specified style does not change. Android. |
any updates? |
Did any one find the fix? |
still looking for a solution and i have a production app for a client any alternatives |
I can take a look at it tonight. Can you list the exact steps to replicate?
|
@eopeter here are my steps to replicate on Android, either simulator or device:
Here is the crash report:
Happy to provide more details if needed. |
its basically the same step to me as well, after repeating 3 times the app close |
I am not able to replicate this with the example app: https://youtu.be/-q8gwWmGdRM |
Thanks for looking into this...So it's in the embedded mode....so i would assign the driver coords as the first way point then the origin of the rider as the second way point....driver then navigate to the rider successfully....driver then swipe arrived ,then swipe to head to the rider destination..in this step I make sure to clear the route first ...then assign the driver location as the first way point then the rider coords as the second waypoint...then route get draw...then as driver hit navigate button...it crashes....if you reopen the app and assign the same way points from state it doesn't crash |
hi @eopeter did you find any solution for the problem sir |
I also got the same problem when using the navigation. Mine works well in the first run, But after that when i try to navigate again the app crash.
Here is the crash report: |
Hello @eopeter is there any solutions or updates sir? Thank you. |
is this issue still happening with the current version 0.2.0? |
@eopeter I will try it with version 0.2.0 and report back. |
hmmmm... In my case:
Now, I can show the route and start the navigation BUT.............. the ManeuverView is blank....... I have no idea why I call "_controller?.finishNavigation();" and it return true @eopeter, is my usage problem?? |
@marciotisouza I got the same status if I do not invoke the finishNavigation() But it will not able to receive the MapBoxEvent.progress_change anymore... |
[Update] And, I found a method to let the MapBoxEvent.progress_change fire after I try to startNavigation() again So, I think the final question is, |
[Update] If I keep the Widget and do not dispose of it, I will get the Surface cache on the top layer... Sorry guys... |
[Update] Someone says that add the below lines into the MainActivity.kt can fix override fun onFlutterTextureViewCreated(flutterTextureView: FlutterTextureView) { But I cannot run the app after add the code |
Did the work around not work? |
I don't know why no error prompt after the project added the workaround code |
@eopeter flutter/flutter#89558 (comment) It should have 2 problems for me
Since the library is required to use
And now, I have new issue 😂 |
Are you able to do a PR to apply the solution? If not, I can look more closely at what you did and see if I can incorporate it |
We can set the background mode to transparent via styles it think |
I did not edit anything of the library. The workaround to handle this issue should be how to config my Flutter app project and change the implementation of the embedded view in my app widget. (The custom MapBoxNavigationViewController & MapBoxNavigationView part mainly is for adding a log to debug.) |
Oh yeah... Following the comment I go to jonbhanson/flutter_native_splash#54 Then the blank screen gone...
|
Hmmm, I guess it should be my final update on this issue. Some of us may use It may have a little bit of embedded view shown on the Android notification bar area if we do not set the notification bar color after the "hybrid component cached to show on the screen top layer issue" My workaround is updating the
Sorry, @eopeter |
Thanks for digging into this. Would definitely like a solution that others can refer to when they encounter this issue. |
@rickylaw-dh Could you do a detailed update as one comment on how you were able to solve this issue? It will really help alot of people. Also if you changed anything on the library you can do a PR. @eopeter Have you had time to look into this issue? I think it has the largest engagement and request |
I would not solve it. I just based on the behavior and applied some workaround to my project The library is good and the main issue is it will crashes when trying to start navigation more than 3 times in embedded view if keeps to create and destroy the widget,
if keeps the widget with GlobalKey and no create and destroy
My step,
@reubendeekay |
@rickylaw-dh Thank you for diving deep and trying to help. Can you please send me a code snippet of the main file and the navigation file to better see your workaround. I will really appreciate it |
@eopeter Please take a look into this issue related to null required view/view binding |
@eopeter Any update? |
is there any update on this? |
@eopeter Any update? |
Hello @eopeter |
Hello, I do not have any update on this |
Hi everyone, I've tried several approaches, but the only way to make it work is by keeping the navigation widget with a global key and never allowing it to be disposed. You can place it at the bottom of the stack when it shouldn't be visible. |
Then another issue may occur... The widget can keeps without crash app, but it could not start navigation normally until the app being to background and then come back to foreground. (I still cannot handle this issue... |
is there any solution found? |
Yes, just avoid using the drop-in UI and manually use the core components by following the Mapbox Examples available at https://github.com/mapbox/mapbox-navigation-android-examples. I have completely rewritten this plugin to meet my company's needs |
Could you please strip off sensitive information for your company and provide us a skeleton of this code. This would go a long way into helping hundreds of people. |
@skaterschikov please reach out to me on mrreubenyt@gmail.com |
here is the the error i get
The text was updated successfully, but these errors were encountered: