追記: Carthage のアップデートによりこの問題は発生しなくなりました。
発生した問題
- Xcode 9
- Carthage を使っている
- AppStore に submit すると下記のような Invalid Bundle というメールが来る
Invalid Bundle - Disallowed LLVM instrumentation. Do not submit apps with LLVM profiling instrumentation or coverage collection enabled. Turn off LLVM profiling or code coverage, rebuild your app and resubmit the app.
Once these issues have been corrected, you can then redeliver the corrected binary.
原因
- Carthage で依存しているライブラリの codeCoverageEnabled が YES になっている
- より詳細は: https://github.com/Carthage/Carthage/issues/2056
対応方法
根本的な解決は現段階では難しいので、とりあえず下記の方法で対処するのが良さそうです.
fastlane での対応方法
fastlane で CI を回しているので carthage で依存を解決するところを下記にような処理にしました.
# ビルドしないでチェックアウトしてくるだけ
carthage(
platform: "iOS",
configuration: "Release",
no_build: true
)
# codeCoverageEnabled を NO にする
cmd = <<"EOS"
grep -lR "codeCoverageEnabled" --include *.xcscheme --null ../Carthage | xargs -0 sed -i '' -e 's/codeCoverageEnabled = "YES"/codeCoverageEnabled = "NO"/g'
EOS
sh(cmd)
# ビルド
carthage(
platform: "iOS",
configuration: "Release",
command: "build"
)