-
Notifications
You must be signed in to change notification settings - Fork 136
Deeplink handling causes GlobalKey conflicts on Android 15+ when app is backgrounded #405
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
Description
Plugin Version
6.15.2
App ID
jp.smartbooks.kodomamo.parentapp
No response
Platform(s)
Android
What did you do?
- The app is already opened and running in the background
- The user launches the app via an AppsFlyer deeplink
What did you expect to happen?
The app should launch from background, handle the deeplink appropriately and shouldn't rebuild the entire app
What happened instead?
The app rebuilds and causes this error:
Duplicate GlobalKey detected in widget tree.
The following GlobalKey was specified multiple times in the widget tree. This will lead to parts of the widget tree being truncated unexpectedly, because the second time a key is seen, the previous instance is moved to the new location. The key was:
- [LabeledGlobalKey<NavigatorState>#8a497]
This was determined by noticing that after the widget with the above global key was moved out of its previous parent, that previous parent never updated during this frame, meaning that it either did not update at all or updated before the widget was moved, in either case implying that it still thinks that it should have a child with that global key.
The specific parent that did not update after having one or more children forcibly removed due to GlobalKey reparenting is:
- HomePage(dependencies: [MediaQuery], state: _HomePageState#7413f)
A GlobalKey can only be specified on one widget at a time in the widget tree.
When the exception was thrown, this was the stack:
#0 BuildOwner.finalizeTree.<anonymous closure> (package:flutter/src/widgets/framework.dart:3317:15)
framework.dart:3317
#1 BuildOwner.finalizeTree (package:flutter/src/widgets/framework.dart:3342:8)
framework.dart:3342
#2 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:1183:19)
binding.dart:1183
#3 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:475:5)
binding.dart:475
#4 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1397:15)
binding.dart:1397
#5 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1318:9)
binding.dart:1318
#6 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1176:5)
binding.dart:1176
#7 _invoke (dart:ui/hooks.dart:312:13)
hooks.dart:312
#8 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:427:5)
platform_dispatcher.dart:427
#9 _drawFrame (dart:ui/hooks.dart:283:31)
hooks.dart:283
════════════════════════════════════════════════════════════════════════════════
Any other relevant information
The issue doesn't occur in iOS and in Android 12 or below. The issue occurs only when the app was opened the first time without the deeplink and backgrounded and then it is opened with the deeplink. The issue was reported on a Pixel 6A running Android 15.
I've checked the assetlinks.json file.
I'm using auto_route for Navigation.
Reactions are currently unavailable