【已解决】Xcode打包OTA包出错:ipatool failed with an exception CmdSpec NonZeroExcitException ...

2018-01-13 10:59:08来源:https://www.crifan.com/xcode_archive_ota_ipa_fail_ipatool_fa作者:在路上人点击

分享

用最新的Xcode 9.2去给已有iOS项目去打包企业版OTA的包:


和之前一样,勾选了Rebuild from bitcode后,填写OTA信息:



继续导出,结果出错:



ipatool failed with an exception: #<CmdSpec::NonZeroExcitException: /Applications/Xcode.app/Contents/Developer/usr/bin/bitcode-build-tool exited with pid 50502 exit 1


Stdout:


Debug: SDK path: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk


Debug: PATH: [‘/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin’, ‘/Applications/Xcode.app/Contents/Developer/usr/bin’]


Debug: Using: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo


MachoInfo: cd /


"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo" "-info" "/var/folders/46/2hjxz38n22n3ypp_5f6_p__00000gn/T/ipatool20180109-48825-1su8b1x/thinned/armv7/Payload/集客管家.app/Frameworks/HTTPStatusCodes.framework/HTTPStatusCodes"


-= Output =-


Non-fat file: /var/folders/46/2hjxz38n22n3ypp_5f6_p__00000gn/T/ipatool20180109-48825-1su8b1x/thinned/armv7/Payload/集客管家.app/Frameworks


点击Show log打开文件夹:



找到log文件:


SalesApp_2018-01-09_11-06-48.453.xcdistributionlogs


IDEDistribution.critical.log


IDEDistribution.standard.log


IDEDistribution.verbose.log


IDEDistributionPipeline.log


找了半天,好像是这个有关系:


/private/var/folders/46/2hjxz38n22n3ypp_5f6_p__00000gn/T/SalesApp_2018-01-09_11-06-48.453.xcdistributionlogs/IDEDistributionPipeline.log



2018-01-09 03:10:37 +0000ary/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 474, in format


s = self._fmt % record.__dict__


UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe9 in position 124: ordinal not in range(128)


Logged from file buildenv.py, line 170


Traceback (most recent call last):


File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 859, in emit


msg = self.format(record)


File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 732, in format


return fmt.format(record)


File



"/Applications/Xcode.app/Contents/Developer/usr/bin/../lib/bitcode_build_tool/buildenv.py", line 44, in format


return super(LogFormatter, self).format(record)


File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 474, in format


s = self._fmt % record.__dict__


UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe9 in position 124: ordinal not in range(128)


Logged from file buildenv.py, line 170


Traceback (most recent call last):


File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 859, in emit


msg = self.format(record)


File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 732, in format


return fmt.format(record)


File "/Applications/Xcode.app/Contents/Developer/usr/bin/../lib/bitcode_build_tool/buildenv.py", line 44, in format


return super(LogFormatter, self).format(record)


File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 474, in format


s = self._fmt % record.__dict__


File "/Applications/Xcode.app/Contents/Developer/usr/bin/../lib/bitcode_build_tool/cmdtool.py", line 31, in __repr__


cmd_string += u"/"" + c + "/" "


UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe9 in position 101: ordinal not in range(128)


Logged from file buildenv.py, line 160


from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2187:in `block in CompileOrStripBitcodeInBundle’


from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2139:in `each’


from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2139:i


2018-01-09 03:10:37 +0000n `CompileOrStripBitcodeInBundle’


from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2323:in `ProcessIPA’


from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2938:in `<main>’



2018-01-09 03:10:37 +0000



2018-01-09 03:10:37 +00002018-01-09 03:10:37 +0000


2018-01-09 03:10:37 +0000


2018-01-09 03:10:37 +0000/Applications/Xcode.app/Contents/Developer/usr/bin/ipatool exited with 12018-01-09 03:10:37 +00002018-01-09 03:10:37 +0000


2018-01-09 03:10:37 +00002018-01-09 03:10:37 +0000


2018-01-09 03:10:37 +0000ipatool JSON: {


alerts =(


{


code = 2817;


description = "Configuration issue: platform WatchSimulator.platform doesn’t have any non-simulator SDKs; ignoring it";


info ={


};


level = WARN;


},


{


code = 2817;


description = "Configuration issue: platform AppleTVSimulator.platform doesn’t have any non-simulator SDKs; ignoring it";


info ={


};


level = WARN;


},


{


code = 2817;


description = "Configuration issue: platform iPhoneSimulator.platform doesn’t have any non-simulator SDKs; ignoring it";


info ={


};


level = WARN;


},


{


code = 653;


description = "ipatool failed with an exception: #<CmdSpec::NonZeroExcitException: /Applications/Xcode.app/Contents/Developer/usr/bin/bitcode-build-tool exited with pid 50502 exit 1/nStdout:/nDebug: SDK path: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/nDebug: PATH: [‘/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin’, ‘/Applications/Xcode.app/Contents/Developer/usr/bin’]/nDebug:



/"/var/folders/46/2hjxz38n22n3ypp_5f6_p__00000gn/T/ipatool20180109-48825-1su8b1x/thinned/armv7/Payload//U96c6/U5ba2/U7ba1/U5bb6.app/Frameworks/HTTPStatusCodes.framework/HTTPStatusCodes/" /"-extract/" /"__LLVM/" /"__bundle/" /"/var/folders/46/2hjxz38n22n3ypp_5f6_p__00000gn/T/HTTPStatusCodesWEh90I/HTTPStatusCodes.armv7.xar/" /n-= Output =-/nExited with 0/n/nDebug: Command took 0 seconds/nDebug: Bitcode bundle version: 1.0/nDebug: Setting platform to: iPhoneOS/nDebug: Using: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld/nDebug: Using: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang/nDebug: Using: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc/nClang: cd /var/folders/46/2hjxz38n22n3ypp_5f6_p__00000gn/T/tempBpON1f/n/"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang/" /"-cc1/" /"-triple/" /"thumbv7-apple-ios8.0.0/" /"-emit-obj/" /"-disable-llvm-passes/" /"-target-abi/" /"apcs-gnu/" /"-mfloat-abi/" /"soft/" /"-Os/" /"-x/" /"ir/" /"1/" /"-o/" /"1.o/" /n-= Output =-/nExited with 0/n/nDebug: Command took 0 seconds/nSwift: cd



/"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py/", line 732, in format/nreturn fmt.format(record)/nFile /"/Applications/Xcode.app/Contents/Developer/usr/bin/../lib/bitcode_build_tool/buildenv.py/", line 44, in format/nreturn super(LogFormatter, self).format(record)/nFile /"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py/", line 474, in format/ns = self._fmt % record.__dict__/nFile /"/Applications/Xcode.app/Contents/Developer/usr/bin/../lib/bitcode_build_tool/cmdtool.py/", line 31, in __repr__/ncmd_string += u/"///"/" + c + /"///" /"/nUnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe9 in position 101: ordinal not in range(128)/nLogged from file buildenv.py, line 160/n>/n/Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:208:in `run’/n/Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2187:in `block in CompileOrStripBitcodeInBundle’/n/Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2139:in `each’/n/Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2139:in `CompileOrStripBitcodeInBundle’/n/Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2323:in `ProcessIPA’/n/Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2938:in `<main>’";


info ={


};


level = ERROR;


type = exception;


}


);


thinnableAssetCatalogs =(


"/var/folders/46/2hjxz38n22n3ypp_5f6_p__00000gn/T/XcodeDistPipeline.BUp/Root/Payload//U96c6/U5ba2/U7ba1/U5bb6.app/Assets.car"


);


}


iosipatool failed with an exception


iosipatool failed with an exception CmdSpec NonZeroExcitException


ios – ipatool failed with an exception – Stack Overflow


Gym in Xcode 9 fails on certificate type. · Issue #9642 · fastlane/fastlane


[support] problems exporting project to an installable app · Issue #172 · watson-developer-cloud/swift-sdk


ipatool failed with an exception: # | Apple Developer Forums


打包问题 – 简书


不勾选Rebuild from bitcode ?


ios – xcodebuild -exportArchive fails with error Locating signing assets failed – Stack Overflow © stackoverflow.com


好像也和bitcode有关系?


Export watchkit archive to ad hoc ipa using xcode · Dushyant Bansal


-》感觉是:


开启了bitcode后,其他库,此处的HTTPStatusCodes.framework也会被重新编译的


-》或许是此处的第三方库,包括HTTPStatusCodes.framework都是之前的Xcode版本(Xcode 9.1? 9.2 beta?的swift 3.2编译的?)


-》所以此处Xcode 9.2的swift 4.0.1再去bitcode重新编译才会出错?


-〉那和之前


【已解决】Xcode编译出错:Module compiled with Swift 4.0.1 cannot be imported in Swift 3.2.3


一样去试试:


先删除就旧的:



再去:



rm -rf ~/Library/Caches/org.carthage.CarthageKit/DerivedData


carthage update –no-use-binaries –platform iOS


结果出错:


➜fleAppiOS /Users/crifan/dev/dev_root/daryun/Projects/Qoros/QorosSales/Sourcecode/SalesAppiOS


➜SalesAppiOS git:(master) ✗ rm -rf ~/Library/Caches/org.carthage.CarthageKit/DerivedData


➜SalesAppiOS git:(master) ✗ carthage update –no-use-binaries –platform iOS


*** Fetching Cartography


*** Fetching MGSwipeTableCell


*** Fetching Alamofire


*** Fetching TextFieldEffects


*** Fetching SwiftyJSON


*** Fetching KMPlaceholderTextView


*** Fetching realm-cocoa


*** Fetching SwiftHEXColors


*** Fetching SwiftHTTPStatusCodes


*** Fetching ActionSheetPicker-3.0


*** Fetching Kingfisher


*** Fetching Charts


A shell task (/usr/bin/env git fetch –prune –quiet origin refs/tags/*:refs/tags/* +refs/heads/*:refs/heads/* (launched in /Users/crifan/Library/Caches/org.carthage.CarthageKit/dependencies/Charts)) failed with exit code 128:


fatal: unable to access ‘ https://github.com/danielgindi/Charts.git/ ‘: LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443


再重新试试


➜SalesAppiOS git:(master) ✗ carthage update –no-use-binaries –platform iOS


*** Fetching Cartography


*** Fetching MGSwipeTableCell


*** Fetching Alamofire


*** Fetching TextFieldEffects


*** Fetching SwiftyJSON


*** Fetching KMPlaceholderTextView


*** Fetching realm-cocoa


*** Fetching SwiftHEXColors


*** Fetching SwiftHTTPStatusCodes


*** Fetching ActionSheetPicker-3.0


*** Fetching Kingfisher


*** Fetching Charts


*** Fetching SwiftKeychainWrapper


*** Fetching DLRadioButton


*** Fetching XCGLogger


*** Checking out Cartography at "1.1.0"


*** Checking out DLRadioButton at "1.4.11"


*** Checking out Charts at "v3.0.5"


*** Checking out SwiftKeychainWrapper at "2.2.1"


*** Checking out Kingfisher at "3.13.1"


*** Checking out ActionSheetPicker-3.0 at "2.3.0"


*** Checking out SwiftHTTPStatusCodes at "3.2.0"


*** Checking out SwiftHEXColors at "1.1.1"


*** Checking out realm-cocoa at "v3.0.2"


*** Checking out KMPlaceholderTextView at "1.3.0"


*** Checking out SwiftyJSON at "4.0.0"


*** Checking out TextFieldEffects at "1.4.0"


*** Checking out Alamofire at "4.6.0"


*** Checking out MGSwipeTableCell at "1.6.6"


*** Checking out XCGLogger at "Version_4.0.0"


*** xcodebuild output can be found in /var/folders/46/2hjxz38n22n3ypp_5f6_p__00000gn/T/carthage-xcodebuild.vVauJ6.log


*** Building scheme "CoreActionSheetPicker" in ActionSheetPicker-3.0.xcworkspace


*** Building scheme "Alamofire iOS" in Alamofire.xcworkspace


*** Building scheme "Cartography-iOS" in Cartography.xcworkspace


*** Building scheme "Charts" in Charts.xcodeproj


*** Building scheme "DLRadioButton" in DLRadioButton.xcodeproj


*** Building scheme "Kingfisher" in Kingfisher.xcworkspace


*** Building scheme "KMPlaceholderTextView" in KMPlaceholderTextView.xcodeproj


*** Building scheme "MGSwipeTableCell" in MGSwipeTableCell.xcodeproj


*** Building scheme "Realm" in Realm.xcworkspace


*** Building scheme "RealmSwift" in Realm.xcworkspace


*** Building scheme "SwiftHEXColors" in SwiftHEXColors.xcodeproj


*** Building scheme "HTTPStatusCodes" in HTTPStatusCodes.xcodeproj


*** Building scheme "SwiftKeychainWrapper" in SwiftKeychainWrapper.xcodeproj


*** Building scheme "SwiftyJSON iOS" in SwiftyJSON.xcworkspace


*** Building scheme "TextFieldEffects" in TextFieldEffects.xcodeproj


*** Building scheme "XCGLogger (iOS)" in XCGLogger.xcodeproj


重新OTA打包试试






结果问题依旧:



ipatool failed with an exception: #<CmdSpec::NonZeroExcitException: /Applications/Xcode.app/Contents/Developer/usr/bin/bitcode-build-tool exited with pid 62040 exit 1


Stdout:


Debug: SDK path: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk


Debug: PATH: [‘/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin’, ‘/Applications/Xcode.app/Contents/Developer/usr/bin’]


Debug: Using: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo


MachoInfo: cd /


"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo" "-info" "/var/folders/46/2hjxz38n22n3ypp_5f6_p__00000gn/T/ipatool20180109-60356-twfl5g/thinned/armv7/Payload/集客管家.app/Frameworks/HTTPStatusCodes.framework/HTTPStatusCodes"


-= Output =-


所以,重新试试,取消bitcode:



然后就正常了,可以去sign这些第三方库,包括上面的HTTPStatusCodes.framework了:




【总结】


此处最终是,在Xcode打包时取消选择:


Rebuild from Bitcode


(Export your app by compiling the bitcode in the same way the App Store does.)


即可。


暂时没时间深究根本的原因:可能是Xcode相关的bug,也可能是其他原因。


【后记】


通过下面的帖子:


ios xcode9 ipatool failed with an exceptionNonZeroExcitException


xcodebuild -exportArchive fails with error Locating signing assets failed


https://q-a-assistant.info/computer-internet-technology/xcodebuild-exportarchive-fails-with-error-locating-signing-assets-failed/1280273


xcodebuild -exportArchive fails with error Locating signing assets failed


http://www.codejaxy.com/q/184308/ios-ipa-xcodebuild-xcode9-beta-xcode9-xcodebuild-exportarchive-fails-with-error-locating-signing-assets-failed


-》


“Xcode 9 recompiles the app from bitcode by default.”


貌似找到根本原因了:


Xcode9默认就已经开启了bitcode功能了


-》所以后续Bitcode就需要关闭了才可以。


-〉所以要打包时要取消勾选:Rebuild from Bitcode


最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台