最新消息:VPS服务器又从fzhost.net换回Linode了,主题仍用朋友推荐的大前端D8

【已解决】Xcode打包失败:xcrun codesign failed with exit code 1

Xcode crifan 29浏览 0评论

Xcode的项目,build和正常调试时是没问题的。

去Clean后Archive打包结果失败:

PhaseScriptExecution Run\ Script /Users/crifan/Library/Developer/Xcode/DerivedData/SRT-cfccwgbddwbjoqbfrtcfvclnuykq/Build/Intermediates.noindex/ArchiveIntermediates/SRTUAT/IntermediateBuildFilesPath/SRT.build/Release-iphoneos/SRTUAT.build/Script-E5549BFD1E89FE9200D646E1.sh

  export TEMP_ROOT=/Users/crifan/Library/Developer/Xcode/DerivedData/SRT-cfccwgbddwbjoqbfrtcfvclnuykq/Build/Intermediates.noindex/ArchiveIntermediates/SRTUAT/IntermediateBuildFilesPath

    export TOOLCHAINS=com.apple.dt.toolchain.XcodeDefault

    export TOOLCHAIN_DIR=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain

    export TREAT_MISSING_BASELINES_AS_TEST_FAILURES=NO

    export UID=501

    export UNLOCALIZED_RESOURCES_FOLDER_PATH=SRTUAT.app

    export UNSTRIPPED_PRODUCT=NO

    export USER=crifan

    export USER_APPS_DIR=/Users/crifan/Applications

    export USER_LIBRARY_DIR=/Users/crifan/Library

    export USE_DYNAMIC_NO_PIC=YES

    export USE_HEADERMAP=YES

    export USE_HEADER_SYMLINKS=NO

    export VALIDATE_PRODUCT=YES

    export VALID_ARCHS=”arm64 armv7 armv7s”

    export VERBOSE_PBXCP=NO

    export VERSIONPLIST_PATH=SRTUAT.app/version.plist

    export VERSION_INFO_BUILDER=crifan

    export VERSION_INFO_FILE=SRTUAT_vers.c

    export VERSION_INFO_STRING=”\”@(#)PROGRAM:SRTUAT  PROJECT:SRT-\””

    export WATCHKIT_2_SUPPORT_FOLDER_PATH=/Users/crifan/Library/Developer/Xcode/DerivedData/SRT-cfccwgbddwbjoqbfrtcfvclnuykq/Build/Intermediates.noindex/ArchiveIntermediates/SRTUAT/BuildProductsPath/WatchKitSupport2

    export WATCHKIT_SUPPORT_FOLDER_PATH=/Users/crifan/Library/Developer/Xcode/DerivedData/SRT-cfccwgbddwbjoqbfrtcfvclnuykq/Build/Intermediates.noindex/ArchiveIntermediates/SRTUAT/BuildProductsPath/WatchKitSupport

    export WRAPPER_EXTENSION=app

    export WRAPPER_NAME=SRTUAT.app

    export WRAPPER_SUFFIX=.app

    export WRAP_ASSET_PACKS_IN_SEPARATE_DIRECTORIES=NO

    export XCODE_APP_SUPPORT_DIR=/Applications/Xcode.app/Contents/Developer/Library/Xcode

    export XCODE_PRODUCT_BUILD_VERSION=9B37

    export XCODE_VERSION_ACTUAL=0910

    export XCODE_VERSION_MAJOR=0900

    export XCODE_VERSION_MINOR=0910

    export XPCSERVICES_FOLDER_PATH=SRTUAT.app/XPCServices

    export YACC=yacc

    export arch=arm64

    export variant=normal

    /bin/sh -c /Users/crifan/Library/Developer/Xcode/DerivedData/SRT-cfccwgbddwbjoqbfrtcfvclnuykq/Build/Intermediates.noindex/ArchiveIntermediates/SRTUAT/IntermediateBuildFilesPath/SRT.build/Release-iphoneos/SRTUAT.build/Script-E5549BFD1E89FE9200D646E1.sh

A shell task (/usr/bin/xcrun codesign –force –sign 4B9A56BDAD9D2BF8C656FC60718CC612161F50C9 –preserve-metadata=identifier,entitlements /Users/crifan/Library/Developer/Xcode/DerivedData/SRT-cfccwgbddwbjoqbfrtcfvclnuykq/Build/Intermediates.noindex/ArchiveIntermediates/SRTUAT/BuildProductsPath/Release-iphoneos/SRTUAT.app/Frameworks/CoreActionSheetPicker.framework) failed with exit code 1:

/Users/crifan/Library/Developer/Xcode/DerivedData/SRT-cfccwgbddwbjoqbfrtcfvclnuykq/Build/Intermediates.noindex/ArchiveIntermediates/SRTUAT/BuildProductsPath/Release-iphoneos/SRTUAT.app/Frameworks/CoreActionSheetPicker.framework: unknown error -1=ffffffffffffffff

Command /bin/sh failed with exit code 1

Frameworks CoreActionSheetPicker.framework: unknown error -1=ffffffffffffffff

xcrun codesign –force –sign failed with exit code 1

codesigning fails with “unknown error -1=ffffffffffffffff” · Issue #8797 · fastlane/fastlane

ios – security / codesign in Sierra: Keychain ignores access control settings and UI-prompts for permission – Stack Overflow

SecKey API returned: -25304 libswiftAVFoundatio… | Apple Developer Forums

去试试,删除那个DerivedData:

/Users/crifan/Library/Developer/Xcode/DerivedData/SRT-cfccwgbddwbjoqbfrtcfvclnuykq/

再重新编译看看结果

如果还是不行,则去参考:

ios – Xcode 8 can’t archive “Command /usr/bin/codesign failed with exit code 1” – Stack Overflow

➜  htttp_summary git:(master) cd ~/Library/Developer/Xcode/DerivedData

➜  DerivedData xattr –help

usage: xattr [-l] [-r] [-s] [-v] [-x] file [file …]

       xattr -p [-l] [-r] [-s] [-v] [-x] attr_name file [file …]

       xattr -w [-r] [-s] [-x] attr_name attr_value file [file …]

       xattr -d [-r] [-s] attr_name file [file …]

       xattr -c [-r] [-s] file [file …]

The first form lists the names of all xattrs on the given file(s).

The second form (-p) prints the value of the xattr attr_name.

The third form (-w) sets the value of the xattr attr_name to the string attr_value.

The fourth form (-d) deletes the xattr attr_name.

The fifth form (-c) deletes (clears) all xattrs.

options:

  -h: print this help

  -l: print long format (attr_name: attr_value and hex output has offsets and

      ascii representation)

  -r: act recursively

  -s: act on the symbolic link itself rather than what the link points to

  -v: also print filename (automatic with -r and with multiple files)

  -x: attr_value is represented as a hex string for input and output

➜  DerivedData which xattr

/usr/bin/xattr

➜  DerivedData xattr -rc .

xattr: No such file: ./SalesApp-fxzzwvtqreanqsgzqmztnatyyjjd/Build/Intermediates.noindex/ArchiveIntermediates/SalesAppDev/BuildProductsPath/Release-iphoneos/SalesAppDev.app

xattr: No such file: ./skodarse-bwynrbdjyclgbwekuzivwzptodnd/Build/Intermediates.noindex/ArchiveIntermediates/skodarseuat/BuildProductsPath/Release-iphoneos/skodarsetest-iPad.app

然后再去试试,问题依旧。

此处系统是macOS High Sierra

 之前记得是没问题的,难道是最近升级了High Sierra后导致的?

Xcode 8 can’t archive “Command /usr/bin/codesig… | Apple Developer Forums

删除整个DerivedData

再去试试

结果出现其他的语法错误了:

Value of type ‘ManageShopVisitViewController’ has no member ‘present’

而此present其实是viewcontroller的自带函数:

想去重新build时,发现有个问题:

目标中的iOS模拟器,好像很多都丢失无法识别了:

而重新build后,又是可以正常编译和运行的:

重新继续archive:

问题依旧。

high sierra xcode 9 codesign failed with exit code 1

Code sign Error -Command /usr/bin/codesign failed with exit code 1 – Support – Appium Discuss

ios – Command /usr/bin/codesign failed with exit code 1 – Stack Overflow

还是不行的话,去试试

https://stackoverflow.com/questions/39868578/security-codesign-in-sierra-keychain-ignores-access-control-settings-and-ui-p

中的:

Allow all applications to access this item

结果看了KeyChain中相关的两个证书都是:

允许所有应用程序访问此项目

没问题啊。

去试试:

security set-key-partition-list -S apple-tool:,apple: -s -k keychainPass keychainName

结果:

➜  DerivedData security set-key-partition-list -S apple-tool:,apple: -s -k keychainPass keychainName

security: SecKeychainUnlock: The specified keychain could not be found.

此处是UAT环境打包失败

去试试其他环境,比如DEV环境看看是否也失败

结果问题依旧:

看来很可能是升级了High Sierra导致的。

此处Xcode中的账号好像都没登录

感觉应该也没影响,毕竟项目配置中是自动管理codesign,看起来都是正常的:

但是还是去登录账号看看

另外,之前登录自己的Apple 开发者账号好像出错:

不知道是否有影响。

再去登录试试。

把所有的账号都登录了。

问题依旧。

How to fix – Command /usr/bin/codesign failed with exit code 1 with Xcode 8.3 | Cocoa and iOS Blogs

说是把app里用的图片从png改为jpg就可以了?

但是项目中所有图片都是png,如果都转换,也觉得很诡异,不应该啊

回到Xcode,试试,取消再勾选自动管理codesign:

【已解决】Mac钥匙串中点击更改登录密码没任何反应

重启Mac后,果然接着就可以正常打包了:

【总结】

此处是升级了macOS High Sierra后,当时要求

1.设置登录密码和Apple开发者账号(==iCloud)的密码,要不一样。

2.后来又很多次跳出登录对话框,让输入iCloud的密码-》由于密码当时记不清

3.以后即时后来输入了正确的密码,但是由于网络问题,没有正常登录成功

4.以及后来虽然网络成功,输入密码正确,但是由于之前某次的弹框,始终没有消失

由此好像导致了:

登录中的苹果相关的(项目的)证书,估计无法正常访问了

-》导致了Xcode去Archive打包项目时,codesign出错。

解决办法是:

确保在升级了macOS High Sierra后,iCloud的登录密码已更新和已登录。

此处是:

  • 重启了Mac,使得之前的弹框消失
  • 在要输入密码时,输入正确的密码,去登录iCloud
  • 如果实在还不行,那就去:KeyChain中重设登录密码
    • 钥匙串访问-》编辑-〉更改钥匙串”登录”的密码

这样Xcode就可以有权限访问密码正确后的钥匙串中的证书了,就可以正常codesign,正常打包了。

转载请注明:在路上 » 【已解决】Xcode打包失败:xcrun codesign failed with exit code 1

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
17 queries in 0.201 seconds, using 9.90MB memory