I am maintaining a project using Carthage. It runs fine and archives fine. But it failed to export enterprise app. The error in "Enterprise distribution options" is
ipatool failed with an exception: #<NoMethodError: undefined method `toolsPath' for nil:NilClass>
If skip "Enterprise distribution options" page by clicking "Next" immediately, result in another error "bitcode_strip failed".
I had searched on stackoverflow, there are many related posts, but no question is the same as my situation so I post a new question.
I followed this post Bitcode_strip failed in Xcode 8 but none of the following solutions works.
I has found an answer and hope to help those who use Carthage. Please check my answer.
Delete *.dSYM "in Carthage/Build/iOS" in Build Phases > Copy Bundle Resources
Reference:
Ref(1) http://ka2n.hatenablog.com/?page=1458709290
Ref(2) https://twitter.com/steipete/status/725816245749166080