Flutter - 错误(Xcode):为“DKImagePickerController-DKImagePickerController”签署需要开发团队 - 选择一个开发团队。

9

我把我的xcode升级到了14.0。在升级了xcode之后,我的Flutter项目出现了以下错误。

select a development team in the Signing & Capabilities editor

目标 > 签名和能力 > 团队 也已选择。
Could not build the precompiled application for the device.
Error (Xcode): Signing for "DKImagePickerController-DKImagePickerController" requires a development team. Select a development team in the Signing & Capabilities editor.
/Users/rsoft/StudioProjects/salezrobot/ios/Pods/Pods.xcodeproj

Error (Xcode): Signing for "DKPhotoGallery-DKPhotoGallery" requires a development team. Select a development team in the Signing & Capabilities editor.
/Users/rsoft/StudioProjects/salezrobot/ios/Pods/Pods.xcodeproj`enter code here`
5个回答

4
这个问题与 XCode 14 的 pods 签名有关。
为了让一切重新正常工作,更新你的 Podfile 内容:
post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)

    # Add the line below
    target_is_resource_bundle = target.respond_to?(:product_type) && target.product_type == 'com.apple.product-type.bundle'

    target.build_configurations.each do |config|

      # And lines from here
      if target_is_resource_bundle
        config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
        config.build_settings['CODE_SIGNING_REQUIRED'] = 'NO'
        config.build_settings['CODE_SIGNING_IDENTITY'] = '-'
        config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = '-'
      end
      # to here

    end
  end
end

然后运行:

flutter pub cache repair
flutter clean
flutter pub get
cd ios
rm -rf Podfile.lock Pods/ .symlinks Flutter/Flutter.podspec
pod install
pod repo update

4
我找到了这个问题的临时解决方案。
Xcode中打开你的Flutter项目。
Pods -> Targets -> Signing & Capabilities -> Select Team

为每个目标选择团队

注意:无论何时构建,都需要执行上述步骤。这不是永久性解决方案。

输入图像描述


1
我正在寻找一个永久的解决方案。 - e a
我也在寻找,如果你找到了解决方案,请告诉我。 - Anand
实际上,我最终找到了一些有用的东西。https://dev59.com/EFEG5IYBdhLWcg3wH0c0 - e a

4

显然,这是Flutter框架中的一个潜在问题,已在2022年9月28日发布的Flutter 3.3.3中得到修复。

此版本提供了热修复清单中的第一项。

尝试运行 flutter upgrade 确保您使用的是最新版本的Flutter。如果问题仍然存在,请尝试在您的项目iOS文件夹中执行flutter clean和手动pod install


1

刚刚将 Flutter 版本更新至 3.3.3
查看修复说明请点击这里


0

修改你的 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|
    target.build_configurations.each do |config|
      if config.build_settings['WRAPPER_EXTENSION'] == 'bundle'
        config.build_settings['DEVELOPMENT_TEAM'] = 'your team id'
      end
    end
  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

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