"ipatool failed with an exception: #<CmdSpec::NonZeroExitException:" on archiving with XCFramwork, Bitcode enabled
Asked Answered
B

2

9

I am unable to archive the ipa when selecting "Rebuild from bitcode" export option, getting the following error

ipatool failed with an exception: #<CmdSpec::NonZeroExitException: $ /Applications/Xcode.app/Contents/Developer/usr/bin/bitcode-build-tool
-v -t /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
-

Note:- I checked all my dependency frameworks are of .xcframework, supporting Bitcode.

Could anyone help me here? Thanks in advance.

Beneficence answered 11/3, 2020 at 13:41 Comment(3)
First, I want to clarify myself that, should I enable "Rebuild from bitcode" option while releasing for enterprise or internal testing. As per my understanding, Apple Appstore rebuilds the app from bitcode, if we have uploaded the ipa with just Bitcode enabled. should I checkmark "Rebuild from bitcode" option while releasing to Appstore?Beneficence
I also had this issue. My workaround was to turn off Bitcode in in Targets > Build Settings > Enable Bitcode. I'd like to know why it doesn't work for when Bitcode is enabled though.Perpend
@Ganeshpatro have you found a solution to your issue? I've faced similar one, so any insights would be greatly appreciated. ThanksHazzard
H
4

We've got similar issue, which is described here. So long story short, there were LLVM instrumentation included, which prevents AppStore processing. I've written a whole blog about XCode 12 and BigSur issues with XCFramework.

To sum up, here is a few required steps to make sure while creating XCFramework for distribution:

  • Using archive builds is a MUST, release build isn't enough
  • BUILD_LIBRARY_FOR_DISTRIBUTION must be set to YES
  • SKIP_INSTALL must be set to NO
  • GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO to turn off GCC instrumentation and remove them from the binary
  • CLANG_ENABLE_CODE_COVERAGE = NO to turn off code coverage tools from the binary

Having all of the above helped to solve our preparing and distribution problem and hopefully save you some time if you happened to face same issues as we did.

Hazzard answered 22/12, 2020 at 9:5 Comment(1)
Didn't help me :(Scholiast
E
1

Got exact same issue,

ipatool failed with an exception: #<CmdSpec::NonZeroExitException: 
$ /Applications/Xcode.app/Contents/Developer/usr/bin/python3...
......

Status: pid 52712 exit 1
Stdout:
    SDK path: /Applications/Xcode.app/Contents/Developer/Platforms
/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.2.sdk

The reason it was generated was, I had bitcode enabled at production target but other targets ( share-extension, debug, share-extension-debug ) and project level bitcode was set to No.

When I enabled all, it worked for me.

Note that, all frameworks and binary I dependant on had bitcode present.

Estoppel answered 17/1, 2022 at 8:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.