"Runner"的签名需要开发团队。在签名和能力编辑器中选择一个开发团队。

26

我无法在发布模式下在我的iPhone上运行我的应用程序,但我可以在调试模式下运行它。

在发布模式下,即使我已经签署了一个团队,我仍然会遇到以下错误:

Signing for "Runner" requires a development team. Select a development team in the Signing & Capabilities editor.

我尝试退出团队并重新登录,还重启了Xcode。

感谢任何帮助。LG

这是正确的吗? enter image description here


3
请确保您选择的团队是全部团队,而不仅仅是调试模式,就像这里演示的一样:https://i.stack.imgur.com/Cp3jq.jpg - Akif
@Akif,我添加了一张图片,这样对吗? - Charles Down
不,这是不正确的。 - Akif
你需要为所有构建模式设置团队。 - Akif
6个回答

38

我猜你没有选择所有的团队,这只是在调试模式下设置的。

输入图片描述


这个Xcode总是让我惊叹不已,它总能想出办法来解决问题。 :3 - undefined

7

对于那些不想添加开发团队 ID 的人,可以按照以下步骤操作:

1- 打开 Podfile 文件

2- 添加以下内容

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |config|
      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
end

3- 运行Pod安装

4- 运行您的项目


这对我有用。我已经在Xcode中选择了开发团队,但仍无法将flutter run运行到我的设备上。我花费了很多很多小时来解决这个问题,并支付了苹果开发者账户的费用来尝试修复它(似乎通过Xcode运行但不是flutter run)。我对Podfiles不是很熟悉,我认为它是在说“如果在物理设备上运行,则不要签名”?这会对发布后产生任何后果吗? - DecafCoder
如果您正在物理设备上运行应用程序,则需要签名证书,您需要添加开发人员帐户,但此解决方案是为了防止其他库请求您的苹果签名证书。@DecafCoder - Abdulrahman Alhayek
好的,谢谢。我曾经认为您可以在没有付费的苹果开发者账户的情况下在您的设备上运行更近期的Flutter应用程序。我会研究“其他库请求苹果签名证书”,以便更好地理解这一点。 - DecafCoder

4

我在升级到XCode 14后遇到了这个问题,错误出现在我的Flutter项目中。

我已经将以下代码添加到我的Podfile的post-install脚本中以禁用代码签名。

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |config|
      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
end

4
从App Store到XCode的整个步骤,包括证书、标识符和配置文件:
Step1:前往“证书、ID和配置文件”
enter image description here Step2:添加新证书
enter image description here enter image description here Step3:从macOS密钥链访问中添加您的个人认证密钥
enter image description here Step4:添加您的标识符
enter image description here Step5:Bundle ID在App Store和Xcode之间应具有相同的名称
enter image description here enter image description here Step6:添加您的配置文件
enter image description here enter image description here enter image description here

我能生成.ipa文件吗?我只需要一个.ipa文件,我有一个免费的开发者账户。 - Ahsan Abrar
@AhsanAbrar 对不起,我之前没有尝试过,但我会尝试一下。 - Willie Cheng

3

对于我来说,在选择开发团队之后,我必须将我的iOS部署目标从8更改为9或更高。

屏幕截图


2

构建设置选项卡对我来说,我必须进入“构建设置”选项卡,搜索“开发团队”,并从可用选项中选择一个值。在“签名和功能”选项卡上更改值并没有自动同步到“构建设置”选项卡。这很可能是xCode 12中的另一个XCode bug。


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