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

IllegalStateException: Calling getLayer when a newer style is loading/has loaded. #1595

Open
digitalfabrik-sentry bot opened this issue Aug 26, 2024 · 3 comments
Labels
Android blocked Task or user story can not be continued at the moment Bug Something isn't working prio: high Issue must be solved within the next weeks. reproduction-needed

Comments

@digitalfabrik-sentry
Copy link

digitalfabrik-sentry bot commented Aug 26, 2024

Sentry Issue: ENTITLEMENTCARD-APP-69

RuntimeException: Unable to destroy activity {app.entitlementcard.nuernberg/app.ehrenamtskarte.MainActivity}: java.lang.IllegalStateException: Calling getLayer when a newer style is loading/has loaded.
    at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:5467)
    at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:5496)
    at android.app.servertransaction.DestroyActivityItem.execute(DestroyActivityItem.java:44)
    at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
...
(7 additional frame(s) were not displayed)

IllegalStateException: Calling getLayer when a newer style is loading/has loaded.
    at com.mapbox.mapboxsdk.maps.a0.y(Style.java:20)
    at com.mapbox.mapboxsdk.maps.a0.i(Style.java:3)
    at com.mapbox.mapboxsdk.location.h0.A(SymbolLocationLayerRenderer.java:3)
    at com.mapbox.mapboxsdk.location.h0.b(SymbolLocationLayerRenderer.java:20)
    at com.mapbox.mapboxsdk.location.q.j(LocationLayerController.java:6)
...
(27 additional frame(s) were not displayed)

Similar Sentry Issue: ENTITLEMENTCARD-APP-6X

Please check how to reproduce this issue.
Maybe it can be fixed with newer maplibre flutter version

Maybe related to: maplibre/flutter-maplibre-gl#477
or maybe related to
maplibre/flutter-maplibre-gl#483

@f1sh1918 f1sh1918 added the Bug Something isn't working label Aug 26, 2024
@f1sh1918 f1sh1918 moved this to Next Up in entitlementcard Aug 26, 2024
@f1sh1918 f1sh1918 added the blocked Task or user story can not be continued at the moment label Aug 26, 2024
@f1sh1918 f1sh1918 removed the status in entitlementcard Aug 26, 2024
@ztefanie ztefanie added the prio: high Issue must be solved within the next weeks. label Sep 9, 2024
@ztefanie ztefanie moved this to Next Up in entitlementcard Sep 9, 2024
@f1sh1918 f1sh1918 moved this from Next Up to Done in entitlementcard Sep 19, 2024
@f1sh1918 f1sh1918 removed the status in entitlementcard Sep 19, 2024
@f1sh1918 f1sh1918 self-assigned this Jan 27, 2025
@f1sh1918 f1sh1918 moved this to In Progress in team-app Jan 27, 2025
@f1sh1918
Copy link
Contributor

It looks like this issue appears to happen if the myLocationEnabled =true

in the last issue i linked in the description a user mentioned that this might be fixed by only enabling this property after
onStyleLoadedCallback
So we might wait for the callback until we enable. I will check if i can reproduce and fix the issue

@f1sh1918
Copy link
Contributor

Hm it appears to be very difficult to reproduce this. Did a lot of tests with different devices and android version on browserstack.
The only way this error occurs for me is Hot reload on local dev environment. And indeed it disappears when userLocation is disabled but i don't think this a proper case.

@f1sh1918 f1sh1918 removed the status in team-app Jan 28, 2025
@f1sh1918 f1sh1918 removed their assignment Jan 28, 2025
@f1sh1918 f1sh1918 moved this to Next Up in team-app Feb 3, 2025
@bahaaTuffaha
Copy link
Contributor

I couldn't reproduce it but this could be a solution:
To use onStyleLoadedCallback and it calls a _onStyleLoaded function that it will change a state to true for myLocationEnabled so we only enabling it when the style is loaded... but I didn't try that yet.

https://stackoverflow.com/a/70582271

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android blocked Task or user story can not be continued at the moment Bug Something isn't working prio: high Issue must be solved within the next weeks. reproduction-needed
Projects
Status: Next Up
Status: No status
Development

No branches or pull requests

3 participants