Fixing `Error (Xcode): Signing for "GoogleSignIn-GoogleSignIn" requires a development team. Select a development team in the Signing & Capabilities editor. [project]/ios/Pods/Pods.xcodeproj`

Today my Flutter project started refusing to compile for iOS with the following errors:

Error (Xcode): Signing for "GoogleSignIn-GoogleSignIn" requires a development team. Select a development team in the Signing & Capabilities editor.
[project]/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.
[project]/ios/Pods/Pods.xcodeproj

I initially tried to manually set my team in XCode for those two projects, even though I don't see why I should. It then fixed the issue, but soon enough, the XCode started throwing the same error again.

So I need to find a more durable solution. Looking at the solutions given on this thread, I am ok trying the solution that does not involve hardcoding the team ID. So after accounting for the previous fix to the Podfile (see my previous post), my config loop looks like this:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
    end
    # From https://stackoverflow.com/a/73747611.
    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
  flutter_additional_ios_build_settings(target)
  end
end

And this fixed the issue.