mapbox / mapbox/mapbox-maps-flutter

[Android] Clicking attribution (info) icon crashing the app

Open
#1,066 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dart
Stars
380
Forks
204
PR merge metrics
No merged PRs in 30d

Description

When clicking on the attribution (info) icon on android the app crashes with the following exception:

```
E/AndroidRuntime(30147): FATAL EXCEPTION: main
E/AndroidRuntime(30147): Process: com.hobaca.hobaca.dev, PID: 30147
E/AndroidRuntime(30147): java.lang.ClassCastException: io.flutter.plugin.platform.WindowManagerHandler cannot be cast to android.view.WindowManagerImpl
E/AndroidRuntime(30147): at android.view.Window.setWindowManager(Window.java:896)
E/AndroidRuntime(30147): at android.view.Window.setWindowManager(Window.java:878)
E/AndroidRuntime(30147): at android.app.Dialog.(Dialog.java:309)
E/AndroidRuntime(30147): at android.app.Dialog.(Dialog.java:282)
E/AndroidRuntime(30147): at androidx.activity.ComponentDialog.(ComponentDialog.kt:42)
E/AndroidRuntime(30147): at androidx.appcompat.app.AppCompatDialog.(AppCompatDialog.java:55)
E/AndroidRuntime(30147): at androidx.appcompat.app.AlertDialog.(AlertDialog.java:98)
E/AndroidRuntime(30147): at androidx.appcompat.app.AlertDialog$Builder.create(AlertDialog.java:982)
E/AndroidRuntime(30147): at androidx.appcompat.app.AlertDialog$Builder.show(AlertDialog.java:1007)
E/AndroidRuntime(30147): at com.mapbox.maps.plugin.attribution.AttributionDialogManagerImpl.showAttributionDialog(AttributionDialogManagerImpl.kt:100)
E/AndroidRuntime(30147): at com.mapbox.maps.plugin.attribution.AttributionDialogManagerImpl.showAttribution(AttributionDialogManagerImpl.kt:67)
E/AndroidRuntime(30147): at com.mapbox.maps.plugin.attribution.AttributionPluginImpl.onClick(AttributionPluginImpl.kt:58)
E/AndroidRuntime(30147): at android.view.View.performClick(View.java:8464)
E/AndroidRuntime(30147): at android.view.View.performClickInternal(View.java:8441)
E/AndroidRuntime(30147): at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
E/AndroidRuntime(30147): at android.view.View$PerformClick.run(View.java:32966)
E/AndroidRuntime(30147): at android.os.Handler.handleCallback(Handler.java:959)
E/AndroidRuntime(30147): at android.os.Handler.dispatchMessage(Handler.java:100)
E/AndroidRuntime(30147): at android.os.Looper.loopOnce(Looper.java:257)
E/AndroidRuntime(30147): at android.os.Looper.loop(Looper.java:342)
E/AndroidRuntime(30147): at android.app.ActivityThread.main(ActivityThread.java:9638)
E/AndroidRuntime(30147): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(30147): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:619)
E/AndroidRuntime(30147): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:929)
D/FirebaseSessions(30147): App backgrounded on com.hobaca.hobaca.dev
I/Process (30147): Sending signal. PID: 30147 SIG: 9
```

The core issue here would be `io.flutter.plugin.platform.WindowManagerHandler cannot be cast to android.view.WindowManagerImpl`. I tried looking online for simmilar errors but couldn't find anything relating to Flutter, so the last resort was to open this issue.

This happens on the following devices:

- Samsung A16 - Android 15
- Redmi Note 12 Pro 5G - Android 14

Mapbox versions:
- 2.12.0
- 2.10.0

Flutter versions:
- 3.38.0
- 3.35.5
- 3.27.4

If any other info is needed I am glad to help.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the crash by tapping the attribution icon on the listed Android devices and compare the reported Flutter and Mapbox versions. The payload names no repository files or tests, so trace the attribution integration from the app entry point into Mapbox's AttributionDialogManagerImpl; done means the dialog opens without the WindowManagerHandler cast exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, dart, flutter
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.