【问题标题】:Flutter IOS build error - "select a development team in the Signing & Capabilities editor."Flutter IOS 构建错误 - “在签名和功能编辑器中选择一个开发团队。”
【发布时间】:2022-09-24 01:13:51
【问题描述】:

尝试在 IOS 设备上构建时显示以下错误:
如下图所示,Xcode中的Signing设置已经做好了。
你能告诉我这个的原因和解决方法吗?

Could not build the precompiled application for the device.
Error (Xcode): Signing for \"GoogleSignIn-GoogleSignIn\" requires a development team. Select a development team in the Signing & Capabilities editor.
/Users/home_1/StudioProjects/Example%20Project/app/ios/Pods/Pods.xcodeproj


Error (Xcode): Signing for \"DKPhotoGallery-DKPhotoGallery\" requires a development team. Select a development team in the Signing & Capabilities editor.
/Users/home_1/StudioProjects/Example%20Project/app/ios/Pods/Pods.xcodeproj


Error (Xcode): Signing for \"DKImagePickerController-DKImagePickerController\" requires a development team. Select a development team in the Signing & Capabilities editor.
/Users/home_1/StudioProjects/Example%20Project/app/ios/Pods/Pods.xcodeproj


Error (Xcode): Signing for \"gRPC-C++-gRPCCertificates-Cpp\" requires a development team. Select a development team in the Signing & Capabilities editor.
/Users/home_1/StudioProjects/Example%20Project/app/ios/Pods/Pods.xcodeproj

  • 检查下面的链接来解决这个问题,POD Install
  • 我面临同样的问题,不幸的是 pod install 对我不起作用。
  • 我使用了 Xcode 14 版本,发现很多人在使用这个最新版本时遇到了同样的问题。于是我恢复到之前的版本后再次尝试,成功了。
  • 这来自 Flutter SDK,Flutter SDK 与最新版本的 xCode 不兼容
  • 面临同样的问题,因为我需要提交构建降级的xcode版本并且它工作

标签: ios flutter


【解决方案1】:

这发生在我今天切换到 Xcode 14 后。尝试将其添加到您的 podfile

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      if config.build_settings['WRAPPER_EXTENSION'] == 'bundle'
        config.build_settings['DEVELOPMENT_TEAM'] = 'YOUR_DEVELOPMENT_TEAM_ID'
      end
    end
  end
end

不要忘记将YOUR_DEVELOPMENT_TEAM_ID 替换为您可以在developer.apple.com 中找到的实际开发团队ID

这将永久解决问题。

如果您不想使用团队 ID,您可以这样做:

post_install do |installer|
  installer.pods_project.targets.each do |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

【讨论】:

  • 这对我有用,但我必须保留这一行:flutter_additional_ios_build_settings(target)
  • 我也会检查这些问题:issue 1issue 2
  • 这解决了这个问题。是什么导致了这个问题?该修复程序是解决 Flutter SDK 或 Xcode 问题的解决方法吗?
  • @Justin 不,这不是颤振问题,它与 Xcode 有关。我自己是本地(swift)开发人员,我遇到了同样的问题
【解决方案2】:

我想知道 Apple 什么时候会推出一个新的 xCode 版本而不破坏以前的版本!

除了咆哮,这就是我修复我的方式基于先前答案的项目:

打开你的 awesome_flutter_project/ios/Podfile:

并替换这些行:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
end

至:

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

【讨论】:

  • 我的只对你的回答有效!差异是:flutter_additional_ios_build_settings(target)。谢谢!
【解决方案3】:

我能够通过执行以下操作来解决问题:

  1. 在 xCode 上打开项目
  2. 打开豆荚并找出“GoogleSignIn-GoogleSignIn”和其他三个豆荚 > 目标
  3. 选择团队签名和能力

【讨论】:

  • 每次安装 pod 后,您都需要执行此操作
【解决方案4】:

将 XCode 更新到版本 14 后,我也收到此错误。

将以下内容添加到ios > podfile

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |config|
      if config.build_settings['WRAPPER_EXTENSION'] == 'bundle'
        config.build_settings['DEVELOPMENT_TEAM'] = 'YOUR_DEVELOPMENT_TEAM_ID'
      end
    end
  end
end

要得到YOUR_DEVELOPMENT_TEAM_IDhttps://developer.apple.com/account/#!/membership/

这将永久解决问题。

如果您不想使用团队 ID,您可以这样做:

post_install do |installer|
  installer.pods_project.targets.each do |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

【讨论】:

    【解决方案5】:

    当我将建议的更改放在文件并运行颤振构建ipa命令,我得到了不同的错误.

    错误:

     In file included from /Volumes/Data/FlutterSDK/.pub-cache/hosted/pub.dartlang.org/webview_flutter_wkwebview-2.9.3/ios/Classes/FWFUIViewHostApi.m:5:
    /Volumes/Data/FlutterSDK/.pub-cache/hosted/pub.dartlang.org/webview_flutter_wkwebview-2.9.3/ios/Classes/FWFUIViewHostApi.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
    #import <Flutter/Flutter.h>
    

    【讨论】:

      猜你喜欢
      • 2021-05-03
      • 2022-10-21
      • 2018-06-26
      • 2017-11-03
      • 2017-07-11
      • 2022-12-17
      • 2018-07-31
      • 2019-08-22
      • 2022-09-27
      相关资源
      最近更新 更多