[英]Signing errors with use_frameworks! and unique provisioning profiles

I am pasting my last post from Initial discussion here:




This issue has been around for almost a year, and still no proper solutions found.


When building:


Code Sign error: Provisioning profile does not match bundle identifier: The provisioning profile specified in your build settings (“MyDistributionProfileName”) has an AppID of “com.myorg.myapp” which does not match your bundle identifier “org.cocoapods.PureLayout”.

Note! PureLayout is added to my pod as a dependency using(in mypod.podspec file): s.dependency 'PureLayout', '3.0.2'


This is the whole podspec file of my Pod:


Pod::Spec.new do |s|
  s.name                = 'MyPod'
  s.version             = '1.2.34'
  s.license             =  { :type => "MIT", :file => "LICENSE" }
  s.homepage            = 'https-:-//bitbucket.org/XXXX123/my-pod'
  s.authors             = { "AuthorName" => "author@myorg.com" }
  s.summary             = 'This isa a cocoa pod that contains the MY framework.'
  s.source              = { :git => "https-:-//bitbucket.org/XXXX123/my-pod", :tag => "#{s.version}" }
  s.ios.deployment_target = '8.0'
  s.source_files        = 'MyPod/**/*.{swift,h}'
  s.resource = 'MyPod/*'
  s.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO', 'ONLY_ACTIVE_ARCH' => 'NO'}
  s.dependency 'PureLayout', '3.0.2'



  1. Dropping use of CocoaPods is not an option.


  2. Using the @DimaVartanian fix leads to similar errors like encountered by @mgrebenets


    ERROR ITMS-90035 Invalid Signature. Code object is not signed at all. Make sure you have signed your application with a distribution certificate, not an ad hoc certificate or a development certificate. Verify that the code signing settings in Xcode are correct at the target level (which override any values at the project level). Additionally, make sure the bundle you are uploading was built using a Release target in Xcode, not a Simulator target. If you are certain your code signing settings are correct, choose "Clean All" in Xcode, delete the "build" directory in the Finder, and rebuild your release target. For more information, please consult https-:-//developer.apple.com/library/ios/documentation/Security/Conceptual/CodeSigningGuide/Introduction/Introduction.html"

    錯誤ITMS-90035簽名無效。代碼對象根本沒有簽名。確保您已使用分發證書(而非臨時證書或開發證書)對您的應用程序進行了簽名。驗證Xcode中的代碼簽名設置在目標級別是否正確(覆蓋項目級別的任何值)。此外,請確保您上傳的軟件包是使用Xcode中的Release目標而不是Simulator目標構建的。如果您確定您的代碼簽名設置正確,請在Xcode中選擇“全部清除”,刪除Finder中的“構建”目錄,然后重建您的發布目標。有關詳細信息,請參閱https - : - / developer.apple.com/library/ios/documentation/Security/Conceptual/CodeSigningGuide/Introduction/Introduction.html“

    ERROR ITMS-90171 Invalid Bundle Structure - The binary file 'XApp.app/Frameworks/X.framework/XView.o' is not permitted. Your app can’t contain standalone executables or libraries, other than the CFBundleExecutable of supported bundles. Refer to the Bundle Programming Guide at https-:-//developer.apple.com/go/?id=bundle-structure for information on the iOS app bundle structure.

    錯誤ITMS-90171無效的包結構 - 不允許使用二進制文件“XApp.app/Frameworks/X.framework/XView.o”。除了支持的捆綁包的CFBundleExecutable之外,您的應用程序不能包含獨立的可執行文件或庫。有關iOS應用程序包結構的信息,請參閱https - : - // developer.apple.com/go/?id=bundle-structure上的“捆綁編程指南”。

  3. My project uses also PushNotifications so can't use any wildcard provision profiles.


  4. Here's my gym line for building a build


    gym --clean --scheme ${XCODE_PROJECT_TARGET_NAME} --configuration Release --include_bitcode false --archive_path ${BUILDS_DIR}${PACKAGE_NAME}.xcarchive --output_directory $BUILDS_DIR --output_name "${PACKAGE_NAME}.ipa" --xcargs PROVISIONING_PROFILE=$APP_PROVISION_UUID

    This line works without any errors when @DimaVartanian fix is applied, but as above, it leads to ERROR ITMS-90035 and ERROR ITMS-90171 during upload process.

    應用@DimaVartanian修復時,此行無任何錯誤,但如上所述,在上載過程中會導致ERROR ITMS-90035和ERROR ITMS-90171。

    Here's my pilot line for uploading a build:


    pilot upload --skip_submission --username ${APPLE_ID_USERNAME} --team_id ${APPLE_ITUNES_CONNECT_TEAM_ID} --verbose --ipa ${BUILDS_DIR}${PACKAGE_NAME}.ipa --skip_waiting_for_build_processing true
  5. I can also confirm that same issue exists when build/archive/upload using xcode.


  6. Adding this --export_options "ExportOptions.plist" to gym commandline, did not make any difference. Also failed by trying via xcargs --xcargs "PROVISIONING_PROFILE=$APP_PROVISION_UUID exportOptionsPlist=$EXPORT_OPTIONS_PLIST".

    將--export_options“ExportOptions.plist”添加到健身房命令行,沒有任何區別。嘗試通過xcargs --xcargs“PROVISIONING_PROFILE = $ APP_PROVISION_UUID exportOptionsPlist = $ EXPORT_OPTIONS_PLIST”也失敗了。

    Contents of the file is as follows:


    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">

I am hoping the CocoaPods team will fix this quickly.


To say in short - what fails is the end of following sequence:

簡而言之 - 失敗的是以下序列的結束:

  1. Create base project in Objectvie-C or take any old maintained Objective-C project
  2. 在Objectvie-C中創建基礎項目或者使用任何舊維護的Objective-C項目
  3. Create and implement a framework (Cocoa Touch Framework) project in Swift
  4. 在Swift中創建並實現一個框架(Cocoa Touch Framework)項目
  5. Create podspec for that framework and upload it to repository
  6. 為該框架創建podspec並將其上載到存儲庫
  7. Include that framework into base project using CocoaPods
  8. 使用CocoaPods將該框架包含到基礎項目中
  9. Build and run app on simulator and on wired device is OK (everything works as expected)
  10. 在模擬器和有線設備上構建和運行應用程序是可以的(一切都按預期工作)
  11. Build and/or Upload to iTunesConnect is NOT OK, it FAILS!
  12. 構建和/或上傳到iTunesConnect不行,它失敗了!

I will try to add a sample project later on, to demo the issue.


1 个解决方案



Ok, so I solved this time this problem my own way. As usually, the solution is easier than ever thought.


The cause of bugger error ERROR ITMS-90171 was this time a directive in podspec file.

bugger錯誤的原因ERROR ITMS-90171這次是podspec文件中的一個指令。

This one: s.resource = 'MyPod/*'

這個:s.resource ='MyPod / *'

No idea how I missed that one, but 'MyPod/*' literally says, include everything in MyPod's directory which besides the graphics assets contained the *.swift files as well.

我不知道我是怎么錯過那個,但是'MyPod / *'字面上說,包含MyPod目錄中的所有內容,除了圖形資源包含* .swift文件外。

So a little fix by changing that line to: s.resource = 'MyPod/Graphics.xcassets' fixed the problem. No ERROR ITMS-90171 any more.

所以通過將該行更改為:s.resource ='MyPod / Graphics.xcassets'來修復問題。沒有錯誤ITMS-90171了。

However, Here we still have to live with a workaround (proposed by @DimaVartanian) that fixes the code-signing requirement for frameworks provided by cocoapods.


The fix itself is to add this code to base project's 'Podfile':


post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
      config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
      config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"

That will go(after 'pod install') through all pod targets in project and remove the code signing requirement by changing certain settings as you can see in code.

這將(在'pod install'之后)通過項目中的所有pod目標,並通過更改某些設置來刪除代碼簽名要求,如代碼中所示。

There are some rumours around, that this workaround will not be required anymore after upgrading to XCode 8. I have not found any official confirmation on this but I hope it is true.

有一些謠言說,升級到XCode 8后不再需要這種解決方法。我沒有找到任何官方確認,但我希望這是真的。



  © 2014-2022 ITdaan.com 联系我们: