Xcode 9, Carthage. iTunes Connect Error: "Invalid Bundle - Disallowed LLVM instrumentation" Xcode 9, Carthage. iTunes Connect Error: "Invalid Bundle - Disallowed LLVM instrumentation" xcode xcode

Xcode 9, Carthage. iTunes Connect Error: "Invalid Bundle - Disallowed LLVM instrumentation"


The solution to automate setting code coverage to false for all dependencies is to run the following command on terminal (please go to the directory of your project):

grep -lR "codeCoverageEnabled" --include *.xcscheme --null Carthage | xargs -0 sed -i '' -e 's/codeCoverageEnabled = "YES"/codeCoverageEnabled = "NO"/g'

This will set code coverage to NO and iTunes connect will not complain.

The sequence to make everything work is the following

  • Run carthage update --platform iOS --no-use-binaries --no-build. This will update and download all dependecies.When Carthage start to compile you can press ctrl+c to cancel.
  • Run the above command to set code coverage to NO
  • Now that everything is into place run carthage build --platform iOS. This will build everything with code coverage to NO

You can now archive and upload to iTC.

The command was given by https://github.com/gunterhager, so credit goes to him


As an alternative for fastlane users, add the following to your fastlane file, which will automate everything:

  desc "Update Carthage"  lane :update_carthage do    carthage(      command: "update",       # One of: build, bootstrap, update, archive. (default: bootstrap)      use_binaries: false,         # Check out dependency repositories even when prebuilt frameworks exist      no_build: true,  # When bootstrapping Carthage do not build      platform: "iOS"  # Define which platform to build for (one ofall’, ‘Mac’, ‘iOS’, ‘watchOS’, ‘tvOS‘, or comma-separated values of the formers except forall’)    )    sh("grep -lR 'codeCoverageEnabled' --include *.xcscheme --null Carthage | xargs -0 sed -i '' -e 's/codeCoverageEnabled = 'YES'/codeCoverageEnabled = 'NO'/g'")    carthage(      command: "build",       # One of: build, bootstrap, update, archive. (default: bootstrap)      platform: "iOS"  # Define which platform to build for (one ofall’, ‘Mac’, ‘iOS’, ‘watchOS’, ‘tvOS‘, or comma-separated values of the formers except forall’)    )  end


As quick fix, run these commands in Terminal (be sure to go to your project's root folder):

  • carthage update --platform iOS --no-use-binaries --no-build This will update your dependencies, but will build nothing.

  • grep -lR "codeCoverageEnabled" --include *.xcscheme --null Carthage | xargs -0 sed -i '' -e 's/codeCoverageEnabled = "YES"/codeCoverageEnabled = "NO"/g' This will set code coverage to NO.

  • carthage build --platform iOS This will finally build all frameworks without code coverage.

Now you can archive your project and upload it to iTunes Connect.

The nice people at the Carthage project are already working on a more user friendly fix, so be sure to check for releases there.


I too got same error from Xcode 9.1 even though I have updated Carthage to latest version https://github.com/Carthage/Carthage/releases I have failed in uploading build to iTunes

enter image description here

Worked for me this way:-

If you have updated your Xcode to 9.1 then

Update your carthage.pkg downloading from https://github.com/Carthage/Carthage/releases

Install .pkg and

Give carthage update command in Terminal by referring to your project

and

then go to you project Build Settings find Enable Code Coverage Support change that setting from Yes to No

enter image description here

Then Archive and upload to AppStore. You build will be ready. Happy!

enter image description here