You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Flutter (Channel stable, v1.17.5, on Mac OS X 10.15.5 19F101, locale en-US)
On Master branch of plugin.
The onStyleLoadedCallback is not called in the example app. Notice if you go to 'Place Symbol' and click on add (asset image) or add (network image) it does not work. That is because these images are setup in the onStyleLoadedCallback which is not called on iOS. This works fine on Android.
Reacted by Philip Lindberg, lj64, Marcos Fonseca, albemala, Anton Avery, Eduardo Pinheiro, Enrico Zamagni, Krzysztof Kubicki and Alexander Lechner
I experienced the same issue just yesterday in my project on ios.
onStyleLoadedCallback fired on first entry into the page containing map.
When I closed it and opened again, it did not fire, even though map tiles were displayed.
Just tested it a couple of times and it seems that the onStyleLoadedCallback is not always fired. On my device in most cases the style is loaded properly but some times it is not and then the icon images are not loaded. Will have to look deeper into this issue.
@TimothySealy The new recommendation is to add symbols in the onStyleLoadedCallback which is why I noticed it in my own project. I thought I would try out the example and noticed the same thing. I had breakpoints there that were not getting hit. I did have it successfully call the callback once if I recall, so I guess it is intermittent like you noticed.
Seeing the exact same thing as @woelmer - tapping on add (asset image) or add (network image) in the example app does nothing on ios because onStyleLoadedCallback is never called.
The only time I can get onStyleLoadedCallback to be called on ios is after reinstalling the app. When the map is generated for the very first time, onStyleLoadedCallback does get called on both ios and android, but every time after that, onStyleLoadedCallback is only called on android.
@woelmer@philiplindberg If you previously added your annotations before onStyleLoadedCallback was fired and that worked for you, you can continue to do this as a workaround. The new documentation wasn't added because we changed any behavior. Adding annotations in onStyleLoadedCallback was always recommended (just less visibly).
I can confirm the issue. Have not been testing on iOS for some time, so not sure when it started happening exactly.
I have updated to 0.8.0 release and also upgraded Flutter to latest available.
Android seems to work fine, on iOS onStyleLoaded is not invoked when map shows.
If I manually (via setState) change map style, callback is invoked, but I do get a crash almost instantly after that. Not sure it's related.
@tobrun We should reopen it. Style callback is not invoked, but looks like it's not in Flutter, it's not properly called from the native part.
I would assume that this should be long fixed in iOS Mapbox, so we should update to the latest and overall somehow keep dependencies up to date for this project. #413
So far for me the issue only seems to reproduce on debug builds. Release builds seem to be fine, at least no users have complained yet.
@aaverin I was able to reproduce this on both release & debug (iOS)... I'm also not sure whether I saw this happening on Android, will check more and get back here if find anything.
Debugging this issue, it seemed as native methods inside Mapbox SDK were not called.
Because flutter-mapbox uses some old versions of Mapbox SDK I have created #413
Some debugging results. map#onStyleLoaded gets called before map#waitForMap, which means that _handleMethodCall in dart is not yet attached correctly and onStyleLoaded invocation will not reach dart codebase.
This results in the bug we have here.
@samderlust In that case we would need your help debugging the issue.
Last fixes for for onStyleLoaded callback reliability were applied in this PR: #808
If you can reliably reproduce the problem can you try debugging your app to see what is the cause exactly?
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.
Activity
TimothySealy commentedon Jul 1, 2020
Hi @woelmer,
I'm trying to reproduce this error but everything seems to work on my device. If I click on
add(asset image)oradd(network image)the symbols are shown with a mapbox icon or placholder image respectively. Looking at the code the onStyleLoadedCallback should be trigger:https://github.com/tobrun/flutter-mapbox-gl/blob/4ce26231f3250b598060063d1b8b65950694754e/ios/Classes/MapboxMapController.swift#L525-L527
Can you verify that the onStyleLoadedCallback is not triggered by adding a breakpoint of print statement in this method:
https://github.com/tobrun/flutter-mapbox-gl/blob/4ce26231f3250b598060063d1b8b65950694754e/example/lib/place_symbol.dart#L48-L51
lj64 commentedon Jul 1, 2020
I experienced the same issue just yesterday in my project on ios.
onStyleLoadedCallback fired on first entry into the page containing map.
When I closed it and opened again, it did not fire, even though map tiles were displayed.
On Android everything was fine.
TimothySealy commentedon Jul 1, 2020
Just tested it a couple of times and it seems that the onStyleLoadedCallback is not always fired. On my device in most cases the style is loaded properly but some times it is not and then the icon images are not loaded. Will have to look deeper into this issue.
woelmer commentedon Jul 2, 2020
@TimothySealy The new recommendation is to add symbols in the onStyleLoadedCallback which is why I noticed it in my own project. I thought I would try out the example and noticed the same thing. I had breakpoints there that were not getting hit. I did have it successfully call the callback once if I recall, so I guess it is intermittent like you noticed.
philiplindberg commentedon Aug 8, 2020
Seeing the exact same thing as @woelmer - tapping on
add (asset image)oradd (network image)in the example app does nothing on ios becauseonStyleLoadedCallbackis never called.The only time I can get
onStyleLoadedCallbackto be called on ios is after reinstalling the app. When the map is generated for the very first time,onStyleLoadedCallbackdoes get called on both ios and android, but every time after that,onStyleLoadedCallbackis only called on android.m0nac0 commentedon Aug 9, 2020
@woelmer @philiplindberg If you previously added your annotations before onStyleLoadedCallback was fired and that worked for you, you can continue to do this as a workaround. The new documentation wasn't added because we changed any behavior. Adding annotations in onStyleLoadedCallback was always recommended (just less visibly).
tonnyavery commentedon Sep 5, 2020
I can confirm the issue. Have not been testing on iOS for some time, so not sure when it started happening exactly.
I have updated to 0.8.0 release and also upgraded Flutter to latest available.
Android seems to work fine, on iOS
onStyleLoadedis not invoked when map shows.If I manually (via setState) change map style, callback is invoked, but I do get a crash almost instantly after that. Not sure it's related.
edufpin commentedon Sep 8, 2020
Happening with me too, my workaround is check OS and if iOS do it manually after onMapCreated.
tonnyavery commentedon Oct 25, 2020
Issue is still present on latest master, after the supposed fix was merged. @andrea689 Was the issue fixed in your tests?
tonnyavery commentedon Oct 25, 2020
Ok, this was an issue on my side, didn't update properly. Seems to be more stable now, I'll keep testing
tonnyavery commentedon Oct 25, 2020
This is still completely unstable for me.
Sometimes callback is called, but most of the times it isn't
tonnyavery commentedon Oct 25, 2020
@tobrun We should reopen it. Style callback is not invoked, but looks like it's not in Flutter, it's not properly called from the native part.
I would assume that this should be long fixed in iOS Mapbox, so we should update to the latest and overall somehow keep dependencies up to date for this project.
#413
tonnyavery commentedon Oct 25, 2020
This callback in
controller.dartnever gets invoked for me12 remaining items
keehoo commentedon Feb 19, 2021
@aaverin I was able to reproduce this on both release & debug (iOS)... I'm also not sure whether I saw this happening on Android, will check more and get back here if find anything.
tonnyavery commentedon Feb 19, 2021
Debugging this issue, it seemed as native methods inside Mapbox SDK were not called.
Because flutter-mapbox uses some old versions of Mapbox SDK I have created #413
jgrandchavin commentedon May 24, 2021
I have exactly the same problem on iOS, still any solution found ?
Sar777 commentedon Jun 30, 2021
any news?
pdcolandrea commentedon Aug 26, 2021
still an issue on 0.12.0, only happening on ios I believe
tonnyavery commentedon Sep 5, 2021
I can also confirm this happening in production builds on real devices.
OnStyleLoaded callback is completely inconsistent on iOS
tonnyavery commentedon Sep 11, 2021
Some debugging results.
map#onStyleLoadedgets called beforemap#waitForMap, which means that_handleMethodCallin dart is not yet attached correctly and onStyleLoaded invocation will not reach dart codebase.This results in the bug we have here.
tonnyavery commentedon Sep 11, 2021
Opened a PR with a fix
samderlust commentedon Jan 5, 2022
I still have this issue with Mapbox 0.14.0?
tonnyavery commentedon Jan 6, 2022
@samderlust In that case we would need your help debugging the issue.
Last fixes for for onStyleLoaded callback reliability were applied in this PR: #808
If you can reliably reproduce the problem can you try debugging your app to see what is the cause exactly?
samderlust commentedon Jan 13, 2022
@aaverin thanks, it fixed with mater branch
stale commentedon Mar 14, 2022
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.
kaspesi commentedon Nov 21, 2024
Im seeing this in mapbox maps 11.8.0