[add-to-app] Cannot re-open Flutter screen after multiple transitions between iOS native and Flutter
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 领域
- mobile-dev
调研方向
从 add_to_app/fullscreen 应用开始,使用列出的 Flutter、Xcode 和 iOS 版本重复复现这些转换。将其生命周期与 add_to_app/plugin 和 add_to_app/multiple_flutters 应用进行比较,重点关注日志中记录的 FlutterViewController 附加错误。完成标准是 Flutter 屏幕可以重复打开和关闭,且不会出现该错误或无法显示的问题。
由索引模型根据 Issue 内容生成。
描述
Steps to Reproduce
- Launch the fullscreen app.
- Tap "Launch Flutter ViewController" to open the Flutter screen.
- Tap "Exit this screen" to close the Flutter screen.
- Repeat steps 2 and 3.
- 💥Tap "Launch Flutter ViewController", but the Flutter screen does not appear.
https://github.com/user-attachments/assets/9f3a406f-4380-4fb7-a633-222a19243fb6
Environment
Flutter: 3.32.4
Xcode: 16.4
iOS Simulator: iPhone 16 (iOS 18.5)
Additional Information
- The following message is logged when attempting to transition to the Flutter screen, even if the transition appears successful.
[ERROR:flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm(183)] The supplied FlutterEngine <FlutterEngine: 0x104807470> is already used with FlutterViewController instance <FlutterViewController: 0x10e808600>. One instance of the FlutterEngine can only be attached to one FlutterViewController at a time. Set FlutterEngine.viewController to nil before attaching it to another FlutterViewController. - Also appeared in the plugin app and an app built following the official guide.
- The number of transitions before the issue appears varies.
- Not appeared in the multiple_flutters app.
- I think setting
flutterEngine.viewController = nilon Flutter screen dismissal would solve the problem, but I don't know if this is the right or recommended solution.
- 主要语言
- Dart
- 星标
- 19.3k
- 派生
- 7.8k
- 平均合并
- 1 天 18 小时
- 30 天内合并 PR
- 4
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
flutter/samples 的其他 Issue
-
[compass_app] UI state never updates for the HomeScreen (regression after the implementation of #2788)可能已有人在做 @Ersaoktaviannn 于 101 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 55/100
-
Many samples use old Gradle, impossible to build on modern JDK可能已有人在做 @ericwindmill 于 664 天前认领。 未关闭bug
-
meta
难度 5/5 一周以上 新手友好度 25/100
-
[navigator2 quickstart] Create a navigator2 quickstart可能重新可做 @mranja 于 40 天前认领,目前没有进行中的 PR。 未关闭enhancement
难度 5/5 一周以上 新手友好度 25/100
-
enhancement
难度 4/5 3-5 天 新手友好度 25/100
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 60/100
hiddify/hiddify-app#2668 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
toyota-connected/emb_cli#358 ·
维护者通常 1 天内回复
-
area: import beta cluster: callers box improvements severity: minor status: confirmed type: bug
难度 2/5 1-3 小时 新手友好度 62/100
ibanner56/CallersCompendium#2366 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
ccch1mneyyy/dsh-Go#1777 ·
维护者通常 1 天内回复
-
area: mobile documentation good first issue
难度 2/5 1-3 小时 新手友好度 76/100
CommandLineCoding/Elephant#383 ·
维护者通常 1 天内回复