用use_frameworks簽名錯誤!和獨特的配置文件

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


I am pasting my last post from Initial discussion here:

我在這里的初步討論中粘貼了我的最后一篇文章:

https://github.com/CocoaPods/CocoaPods/issues/4331

https://github.com/CocoaPods/CocoaPods/issues/4331

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'

注意!使用(在mypod.podspec文件中)將PureLayout作為依賴項添加到我的pod中:s.dependency'PureLayout','3.0.2'

This is the whole podspec file of my Pod:

這是我的Pod的整個podspec文件:

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'
end

Notes:

筆記:

  1. Dropping use of CocoaPods is not an option.

    暫停使用CocoaPods不是一種選擇。

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

    使用@DimaVartanian修復程序會導致類似@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.

    我的項目也使用PushNotifications,因此不能使用任何通配符配置文件。

  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.

    我還可以確認使用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">
    <dict>
       <key>teamID</key>
       <string>TEAMID123</string>
       <key>uploadSymbols</key>
       <string>NO</string>
       <key>compileBitcode</key>
       <false/>
       <key>uploadBitcode</key>
       <false/>
       <key>method</key>
       <string>app-store</string>
    </dict>
    </plist>
    

I am hoping the CocoaPods team will fix this quickly.

我希望CocoaPods團隊能夠迅速解決這個問題。

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 个解决方案

#1


3  

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.

但是,在這里,我們仍然需要采用一種解決方法(由@DimaVartanian提出)來修復cocoapods提供的框架的代碼簽名要求。

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

修復本身是將此代碼添加到基礎項目的'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"
    end
  end
end

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后不再需要這種解決方法。我沒有找到任何官方確認,但我希望這是真的。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2016/08/26/b7ebeb5a25da29edf80d36ab357115d3.html



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