bug(ios): 8.5 template creates the bridge view controller twice (storyboard scene key + SceneDelegate)
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 57/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- swift, typescript
調査の方向性
Start with the generated iOS SPM template’s Info.plist, SceneDelegate, and Main.storyboard, then compare them with the 8.5 update guide and cap migrate behavior. Check how the scene manifest and storyboard settings interact with the SceneDelegate-created window. Done means the template and migration guidance use one consistent setup and a generated app launches with one bridge.
索引モデルが issue の本文から書いたものです。
説明
Capacitor Version
@capacitor/cli 8.5.3, @capacitor/ios 8.5.x (iOS SPM template)
Other API Details
Xcode 27.2, iOS 26.5 Simulator
Platforms Affected
- iOS
- Android
- Web
Current Behavior
The 8.5 iOS template (and the 8.5 update guide) configures the window in two ways at once:
Info.plistsetsUISceneStoryboardFile = Mainin the scene manifest, and still setsUIMainStoryboardFile = Main. The initial view controller ofMain.storyboardisCAPBridgeViewController.SceneDelegate.scene(_:willConnectTo:options:)creates its ownUIWindowand a newCAPBridgeViewController()in code.
Because the scene manifest names a storyboard, UIKit instantiates the storyboard's initial view controller on every launch before calling scene(_:willConnectTo:). The SceneDelegate then replaces the window, and the storyboard's controller is deallocated without loading its view.
I confirmed this by logging in a CAPBridgeViewController subclass. On each launch, both a normal launch and a background launch from a silent push, there is one init(coder:) (storyboard), one init(nibName:bundle:) (SceneDelegate), one capacitorDidLoad(), and one deinit.
In my testing the extra controller never loads a bridge, so this is redundant work, not a confirmed functional bug. I'm raising it because the setup is ambiguous: two code paths can create a CAPBridgeViewController, and the guide says Main.storyboard "no longer provides" the window or root view controller.
For context, we're investigating rare production cases on iOS where two bridges (two web app instances) appeared to run at once in a Capacitor 8.5 app, which showed up as SQLite database is locked errors. I could not tie that to this template setup, and I'm not claiming it is the cause.
Expected Behavior
The window and root view controller are created in one place. Since the SceneDelegate builds them in code, I'd propose the template drops the storyboard references:
- Remove
UISceneStoryboardFilefrom the scene configuration inInfo.plist. - Remove
UIMainStoryboardFilefromInfo.plist. It is ignored when a scene manifest is present. - Optionally remove
Main.storyboardfrom the template, and update the 8.5 guide andcap migrateto match.
The other option is to keep the storyboard and have the SceneDelegate use the window UIKit creates, without building its own. Then a custom CAPBridgeViewController subclass would be set in the storyboard, as before 8.5.
Is dropping the storyboard keys what you'd recommend for apps that have migrated? Or is there a reason the template keeps both?
Project Reproduction
Any new app from the @capacitor/cli 8.5.3 iOS SPM template (npx cap add ios). No custom code is needed except the logging below.
Additional Information
Steps to observe:
- In the generated iOS project, create
class AppViewController: CAPBridgeViewControllerthat logs ininit(coder:),init(nibName:bundle:),capacitorDidLoad()anddeinit. - Set it as the custom class of the initial view controller in
Main.storyboard, and use it inSceneDelegate(window?.rootViewController = AppViewController()), as the guide suggests for custom subclasses. - Launch the app and watch the log: there are two initializers and one
deinitper launch. - With
UISceneStoryboardFileandUIMainStoryboardFileremoved fromInfo.plist, the app still launches normally with one bridge, created by the SceneDelegate.
- 主要言語
- TypeScript
- スター
- 17.1k
- フォーク
- 1.3k
- 平均マージ
- 2日 1時間
- マージ済み PR(30日)
- 32
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ionic-team/capacitor のほかの issue
-
[Bug]: Plugin call after navigation can be answered before reply proxy is updated対応中かも @MateStrysewske が 56 日前に担当しました。 オープンtriage
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
ionic-team/capacitor#8616 ·
メンテナーはふだん 2 日以内に返信
-
[Bug]: SystemBars shrinks the WebView twice for the keyboard on Android 10 (API 29) when WebView >= 140 and viewport-fit=cover対応中かも @theproducer が 18 日前に担当しました。 オープンneeds reply
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ionic-team/capacitor#8601 · コメント 2 件 · リアクション 3 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ionic-team/capacitor#8574 · コメント 3 件 ·
メンテナーはふだん 2 日以内に返信
-
SystemBars: safe area CSS injection throws "Cannot read properties of null" on startup (Android 16)対応中かも @kttalley が 47 日前に担当しました。 オープンtriage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ionic-team/capacitor#8530 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
fix(android): remove unchecked Java compilation warnings対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンtriage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ionic-team/capacitor#8529 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
ionic-team/capacitor の issue をすべて見る
似ている issue
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
lingdojo/kana-dojo#34223 · コメント 1 件 · リアクション 5 件 ·
メンテナーはふだん 1 日以内に返信
-
bug status: needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
mastra-ai/mastra#30587 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area:web p2 product:business triage:active type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
cuadrao-ai/argus#2228 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
embedpdf/embed-pdf-viewer#1098 ·
メンテナーはふだん 1 日以内に返信
-
.Needs Triage .Team/Metabot Priority:P3 Type:Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
metabase/metabase#87252 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信