用use_frameworks签名错误!和独特的配置文件 [英] Signing errors with use_frameworks! and unique provisioning profiles

查看:453
本文介绍了用use_frameworks签名错误!和独特的配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在上面的初步讨论中粘贴了我的上一篇文章:

I am pasting my last post from Initial discussion here:

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

此问题已存在近一年,仍然没有找到合适的解决方案。

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

构建时:

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".

注意!使用(在mypod.podspec文件中)将PureLayout作为依赖项添加到我的pod:
s.dependency'PureLayout','3.0.2'

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

这是我的Pod的整个podspec文件:

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






注意:


Notes:


  1. 删除CocoaPods的使用不是一种选择。

  1. Dropping use of CocoaPods is not an option.

使用@DimaVartanian修复导致类似的错误,如@mgrebenets遇到的

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


错误ITMS-90035 签名无效。代码对象根本没有签名。确保您已使用分发证书(而非临时证书或开发证书)对您的应用程序进行了签名。验证Xcode中的代码签名设置在目标级别是否正确(覆盖项目级别的任何值)。此外,请确保您上传的软件包是使用Xcode中的Release目标而不是Simulator目标构建的。如果您确定您的代码签名设置正确,请在Xcode中选择全部清除,删除Finder中的构建目录,然后重建您的发布目标。有关详细信息,请参阅https - : - / developer.apple.com/library/ios/documentation/Security/Conceptual/CodeSigningGuide/Introduction/Introduction.html

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-90171 无效的捆绑包结构 - 不允许使用二进制文件XApp.app/Frameworks/X.framework/XView.o。您的应用不能包含独立的可执行文件或库,其他支持捆绑包的CFBundleExecutable。有关iOS应用程序包结构的信息,请参阅https - : - // developer.apple.com/go/?id=bundle-structure上的捆绑编程指南。

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.


  • 我的项目也使用了PushNotifications,因此无法使用任何通配符配置文件。

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

    这是我用于构建构建的健身房线

    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
    

    此行有效,没有任何错误应用@DimaVartanian修复时,如上所述,在上传过程中会导致错误ITMS-90035 错误ITMS-90171

    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.

    这是我的上传版本的试用版:

    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
    


  • 我还可以确认使用xcode进行构建/存档/上传时存在同样的问题。

  • I can also confirm that same issue exists when build/archive/upload using xcode.

    添加此 - export_optionsExportOptions.plist到健身房命令行,没有任何区别。尝试通过xcargs 也失败了 - xcargsPROVISIONING_PROFILE = $ APP_PROVISION_UUID exportOptionsPlist = $ EXPORT_OPTIONS_PLIST

    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".

    内容该文件如下:

    <?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>
    


  • 我希望CocoaPods团队能解决这个问题很快。

    I am hoping the CocoaPods team will fix this quickly.

    简而言之 - 失败的是以下序列的结束:

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


    1. 在Objectvie-C中创建基础项目或者使用任何旧维护的Objective-C项目

    2. 在Swift中创建并实现框架(Cocoa Touch Framework)项目

    3. 为该框架创建podspec并将其上传到存储库

    4. 使用CocoaPods将该框架包含到基础项目中

    5. 在模拟器和有线设备上构建和运行应用程序是正常的(一切正常工作)

    6. 构建和/或上传到iTunesConnect不行,它失败了!

    1. Create base project in Objectvie-C or take any old maintained Objective-C project
    2. Create and implement a framework (Cocoa Touch Framework) project in Swift
    3. Create podspec for that framework and upload it to repository
    4. Include that framework into base project using CocoaPods
    5. Build and run app on simulator and on wired device is OK (everything works as expected)
    6. Build and/or Upload to iTunesConnect is NOT OK, it FAILS!

    我稍后会尝试添加一个示例项目来演示此问题。

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

    推荐答案

    好的,所以我这次解决了这个问题。
    通常,解决方案比以往任何时候都容易。

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

    bugger错误的原因ERROR ITMS-90171这次是podspec文件中的指令。

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

    这一个: s.resource ='MyPod / *'

    不知道我是怎么错过那个,但是'MyPod / *'字面上说,包含MyPod目录中的所有内容,除了图形资源还包含* .swift文件。

    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.

    通过将该行更改为: s.resource ='MyPod / Graphics.xcassets'来解决问题。没有错误ITMS-90171。

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

    然而,
    这里我们仍然需要解决方法(由@DimaVartanian提出,修复了由cocoapods提供的框架的代码签名要求。

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

    修复本身是将此代码添加到基础项目的'Podfile':

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

    这将('pod install'之后) )通过项目中的所有pod目标,并通过更改某些设置来删除代码签名要求,如代码中所示。

    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.

    有一些谣言,这种解决方法不会升级到XCode 8后再被要求了。我没有找到任何官方确认,但我希望这是真的。

    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.

    这篇关于用use_frameworks签名错误!和独特的配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆