ios – 使用use_frameworks签名错误!和独特的配置文件

我在这里的初步讨论中粘贴了我的最后一篇文章:

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

这个问题已经存在了将近一年,但仍未找到适当的解决方案.

建设时:

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′

这是我的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

笔记:

>暂停使用CocoaPods不是一种选择.
>使用@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”

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,因此无法使用任何通配符配置文件.
>这是我建造建筑物的健身房线

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修复时,此行无任何错误,但如上所述,在上载过程中会导致ERROR ITMS-90035和ERROR ITMS-90171.

这是我上传构建的试验线:

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进行构建/存档/上传时存在同样的问题.
>将此–export_options“ExportOptions.plist”添加到健身房命令行,没有任何区别.尝试通过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团队能够迅速解决这个问题.

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

>在Objectvie-C中创建基础项目或者使用任何旧维护的Objective-C项目
>在Swift中创建并实现一个框架(Cocoa Touch Framework)项目
>为该框架创建podspec并将其上载到存储库
>使用CocoaPods将该框架包含到基础项目中
>在模拟器和有线设备上构建和运行应用程序是可以的(一切都按预期工作)
>构建和/或上传到iTunesConnect不行,它失败了!

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

解决方法

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

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

这个:s.resource =’MyPod / *’

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

所以通过将该行更改为:s.resource =’MyPod / Graphics.xcassets’来修复问题.没有错误ITMS-90171了.

然而,
在这里,我们仍然需要采用一种解决方法(由@DimaVartanian提出)来修复cocoapods提供的框架的代码签名要求.

修复本身是将此代码添加到基础项目的’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目标,并通过更改某些设置来删除代码签名要求,如代码中所示.

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

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...