Hi everyone,
I have an existing Flutter project where deep linking was working perfectly before. Recently, I upgraded my Flutter SDK, Android Studio, Android SDK, Gradle/AGP, etc. The project code and deep-link implementation were not intentionally changed.
After the upgrade, I’m facing two issues:
Debug build:
When the app is running in the background and I open a deep link from WhatsApp/Google Chat, the app sometimes crashes or gets stuck on a black screen. I’m seeing logs related to SurfaceView, performTraversals, predraw, and WIN DEATH.
Release build:
The app opens from the deep link, but it appears to take over the Android task/intent stack. After opening the link from WhatsApp or Google Chat, I cannot reopen the originating app normally until I close my Flutter application.
I have already verified that Digital Asset Links / assetlinks.json is not the issue. The same deep-link implementation worked correctly before the environment upgrades.
I suspect this may be related to Android activity/task configuration, such as launchMode, taskAffinity, intent flags, MainActivity, startup theme/window configuration, or changes in Flutter/AGP/Android behavior.
Has anyone experienced this after upgrading Flutter/Android tooling? What configuration should I check or change to fix both the debug black-screen/crash and the release task-stack behavior?
Top comments (1)
Two things changed underneath you that fit "worked before the upgrade":
app_linksoruni_links, both now receive the link and both navigate. Setflutter_deeplinking_enabledtofalsein the manifest's<meta-data>if your package is meant to own it.VIEWintent withoutFLAG_ACTIVITY_NEW_TASK, Android puts astandardorsingleTopactivity on top of the caller's task. Switching back to WhatsApp then shows that task, with your app on top of it: "can't reopen the originating app until I close mine". The Flutter template usessingleTop;singleTaskkeepsMainActivityin your own task and delivers later links throughonNewIntent.Before changing anything, confirm it: open a link from WhatsApp, run
adb shell dumpsys activity activities, and look at which task yourMainActivitysits under. Either change could also explain the debug black screen, so re-test that after each one.