iOS Catalyst Cocoapod框架错误 - 签名需要开发团队

13

我正在更新我的iOS应用程序使其能够在Mac上运行。选择Mac复选框后,当尝试为Mac构建时,屏幕截图中的错误信息如下所示。它告诉我需要为这个Cocoapod框架选择一个开发团队。但是,我可以在不选择开发团队的情况下构建iPhone或iPad。

我尝试选择了一个开发团队,这使得错误消失了。但是,当我将应用程序二进制文件上传到Apple时,却被拒绝,并显示以下错误:ITMS-90284: 代码签名无效 - 可执行文件'Timestamp.app/Contents/Frameworks/BSImagePicker.framework/Versions/A/Resources/BSImagePicker.bundle'必须使用包含在配置文件中的证书进行签名。

我认为我之所以会收到来自Apple的这个错误,是因为我为这个Cocoapod框架选择了一个开发团队。

有什么建议可以处理这个Catalyst应用程序的错误吗?

Mac编译错误


你有付费的苹果开发者账户吗? - Andrew
@Andrew 是的,而且iOS应用商店上已经有多个应用程序了。 - chickenparm
3
我也遇到了同样的问题。与 CocoaPods 的这个问题有关:https://github.com/CocoaPods/CocoaPods/issues/8891 - Chris Ballinger
4个回答

6

我通过将每个 poddevelopment team 设置为 pod install 过程中解决了这个问题,就像 CocoaPods 存储库中的这个问题所描述的那样:https://github.com/CocoaPods/CocoaPods/issues/8891#issuecomment-546636698

您需要在 Podfile 的末尾添加以下内容:

def fix_config(config)
  if config.build_settings['DEVELOPMENT_TEAM'].nil?
    config.build_settings['DEVELOPMENT_TEAM'] = '<YOUR TEAM ID HERE>'
  end
end

post_install do |installer|
  installer.generated_projects.each do |project|
    project.build_configurations.each do |config|
        fix_config(config)
    end
    project.targets.each do |target|
      target.build_configurations.each do |config|
        fix_config(config)
      end
    end
  end
end

接下来需要执行 pod install 来使其工作。

你可以在这里找到你的 team idhttps://developer.apple.com/account/#!/membership

2022年秋季苹果开发者网站

enter image description here

旧版苹果开发者网站

enter image description here


3

我在使用MessageKitAssets时遇到了问题,以下方法对我有效:

从Pods目标中选择MessageKitAssets,

手动选择一个团队,并设置签名证书为“sign to run locally”(针对macOS平台),使用iOS bundle id,无需配置文件。


2
截至2021年1月,仍存在问题;选择自己的“团队”和“本地运行签名”对我来说也是缺失的一部分。在执行此操作后,我能够上传我的Mac Catalyst二进制文件,并且没有出现任何问题。 - lukemmtt
@lukemmtt 你找到解决方案了吗? - Vlad Khambir
@VladKhambir 不,除了Sam Xu在这里提出的解决方法之外,没有其他更好的方法。这种解决方法很繁琐,因为每次我构建Mac Catalyst时都需要在5个不同的框架上执行它,但是它可以完成工作,并且我的应用程序通过了App Store审核。 - lukemmtt

1
post_install do |installer|

1. Add the below code at the end of POD file.
2. Install the pod again
3. Run the app

installer.pods_project.targets.each do |target|
  if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
    target.build_configurations.each do |config|
        config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
    end
  end
 end
end

-5

将以下内容添加到您的podfile文件顶部:

source 'https://github.com/CocoaPods/Specs.git'


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接