よろしくお願いします。
アプリをapple store connectに申請しましたが、以下の理由によりリジェクトされました。
Your app crashed on iPad running iOS 13.6 on WiFi when we:
Tapped on Share button.
We have attached detailed crash logs to help troubleshoot this issue.
実際にシュミレータで起動してみると
確かにiPadでシェアボタンを押すとクラッシュしていまします。
iphoneでは正常に起動に反応します。
どのように対応すれば良いでしょうか。
シェアボタンのコードは以下になります。

よろしくお願いいたします。
<途中経過>
・上記質問からコードを追加した。
・shareボタンを押した後、activityControllerは出現するようになった。
・しかし、activityController出現後にクラッシュするようになった。
・当初はシュミレーターのiPadのみでクラッシュしたが、iphoneでもクラッシュするようになった。
https://qiita.com/unsoluble_sugar/items/d41e6b2b6e3ca3b83be7
この辺りとかは関連しないでしょうか。
関連しそうですね。他のサイトもいくつかヒントがあります。
https://www.it-swarm-ja.tech/ja/ios/ios-8-ipadでuiactivityviewcontrollerがクラッシュする/1047789078/
https://stackoverrun.com/ja/q/8123912
しかしどのようにコードを打てば良いのか・・・。
UIAlertController の例ですが、
let cancelAction = UIAlertAction(title: "キャンセル", style: .cancel, handler: nil)
alertController.addAction(cancelAction)
// iPad 対策
alertController.popoverPresentationController?.sourceView = view
こんな感じでクラッシュ対策していました。
UIActivityController も同じプロパティがあるので、 view を代入すれば解決しそうですが、いかがでしょうか。
ありがとうございます。
// iPad 対策
activityVC.popoverPresentationController?.sourceView = view
を打ち込みました。シュミレーターではクラッシュエラーは無くなりました。
しかしボタンを押しても何も反応しません。
以下のメッセージが出ます。
2020-07-23 12:55:33.388241+0900 test[20546:1109055] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x600002d1ec10 LPLinkView:0x7fca3140a9f0.leading == UILayoutGuide:0x6000037a65a0'UIViewLayoutMarginsGuide'.leading (active)>",
"<NSLayoutConstraint:0x600002d1e7b0 H:[LPLinkView:0x7fca3140a9f0]-(59)-| (active, names: '|':_UIActivityContentTitleView:0x7fca3140bc20 )>",
"<NSLayoutConstraint:0x600002d70af0 H:|-(0)-[_UIActivityContentTitleView:0x7fca3140bc20] (active, names: '|':_UINavigationBarContentView:0x7fca314123c0 )>",
"<NSLayoutConstraint:0x600002d70b40 _UIActivityContentTitleView:0x7fca3140bc20.trailing == _UINavigationBarContentView:0x7fca314123c0.trailing (active)>",
"<NSLayoutConstraint:0x600002d74f00 'UIView-Encapsulated-Layout-Width' _UINavigationBarContentView:0x7fca314123c0.width == 0 (active)>",
"<NSLayoutConstraint:0x600002d1ed00 'UIView-leftMargin-guide-constraint' H:|-(16)-[UILayoutGuide:0x6000037a65a0'UIViewLayoutMarginsGuide'](LTR) (active, names: '|':_UIActivityContentTitleView:0x7fca3140bc20 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600002d1ec10 LPLinkView:0x7fca3140a9f0.leading == UILayoutGuide:0x6000037a65a0'UIViewLayoutMarginsGuide'.leading (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
ボタンが押せないことと直接関係あるか分かりませんが、少なくとも制約に関する警告が出ていることは間違いないかとおもいます。
たとえば、UIActivityControllerだけを出すごく簡単なサンプルを作り、それがiPhone/iPad双方で問題がないことを確認し、それから少しずつレイアウトなどを今回のアプリに揃えてゆき、どこで問題が発生するのか確認されてみるのはいかがでしょうか。
ありがとうございます。試してみます。
また何かありましたら質問させていただきます。
回答1件
あなたの回答
tips
プレビュー





