0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[SwiftUI] リリースビルドでクラッシュして困った

Posted at

起こったこと

デバッグビルドではクラッシュしないが、リリースビルドでクラッシュする

adhoc build -> firebase distributionsで配布して実機で確認しようとした。

すると、特定の画面でクラッシュする現象が起きたので、以下の記事やstackoverflowを参考に再度ビルド・配布をした。

が、治らず🥺

他の端末だとクラッシュしないだとか、OSのバージョンだとか、いろいろ検討したのだが...↓

結論

デバッグ用に表示していたViewのせいでクラッシュしていた

クラッシュするViewの子Viewとして、以下のようなViewを置いていた

# if DEBUG
  Button {
    // ...
  } label: {
    Text("ログアウト")
  }
# endif

「そういえば、デバッグ用のViewを置いているのはここだけだな...」と思いついて試しにコメントアウトしてみるとビンゴだった。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?