Today I downloaded Xcode 9 and made the necessary changes for my application to compile. The application is compiling and running locally without any issues.
Using Xcode 9 I uploaded it to the App Store. Upload was successful without any errors.
I then go the following email from Apple:
Dear developer,
We have discovered one or more issues with your recent delivery for "KiteSpotter - Kitesurf wind and weather forecast". To process your delivery, the following issues must be corrected:
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.
Regards,
The App Store team
I went and turned off code coverage for both my target and cocoa pods target, which was the only relevant setting I could find:
Resubmitted the application and I am getting the same error.
On my project I am using Carthage, which has more than 15 dependencies. Searching for a solution I found that all projects need to be updated with the above setting.
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
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. carthage build --platform iOS
. This will build everything with code coverage to NOYou 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 of ‘all’, ‘Mac’, ‘iOS’, ‘watchOS’, ‘tvOS‘, or comma-separated values of the formers except for ‘all’)
)
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 of ‘all’, ‘Mac’, ‘iOS’, ‘watchOS’, ‘tvOS‘, or comma-separated values of the formers except for ‘all’)
)
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
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
Then Archive and upload to AppStore
. You build will be ready
. Happy
!
Just update Carthage
to version 0.26.0
or higher and then run the carthage update
command again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With