Skip to content

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

@IvanLjubicicSW

Description

@IvanLjubicicSW

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.<init>(Dialog.java:309)
E/AndroidRuntime(30147): 	at android.app.Dialog.<init>(Dialog.java:282)
E/AndroidRuntime(30147): 	at androidx.activity.ComponentDialog.<init>(ComponentDialog.kt:42)
E/AndroidRuntime(30147): 	at androidx.appcompat.app.AppCompatDialog.<init>(AppCompatDialog.java:55)
E/AndroidRuntime(30147): 	at androidx.appcompat.app.AlertDialog.<init>(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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions