32

The following error is displayed when attempting to build on an IOS device:
As shown in the picture below, the Signing setting in Xcode is well done.
Can you tell me the cause and solution of this?

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

enter image description here

6
  • Check the link below to solve this issue, POD Install Sep 14, 2022 at 5:22
  • I face the same problem and unfortunately pod install did not work for me. Sep 14, 2022 at 11:18
  • 1
    I used Xcode 14 version and found that many people faced the same problem with this latest version. So I tried again after reverting to the previous version and succeeded.
    – Kevin Yang
    Sep 15, 2022 at 1:23
  • This is coming from Flutter SDK, Flutter SDK is not compatible with latest version of xCode
    – BIS Tech
    Sep 16, 2022 at 2:40
  • Facing the same issue, as I needed to submit the build downgraded the xcode version and it worked
    – Parul Garg
    Sep 16, 2022 at 14:27

12 Answers 12

55

This happened to me today after switching to Xcode 14. Try adding this to your 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

Don't forget to replace the YOUR_DEVELOPMENT_TEAM_ID with your actual development Team ID which you can find in developer.apple.com

This will permanently fix the issue.

If you don't want to use the Team ID you can do this instead:

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

If you have other post_install steps, for example flutter_additional_ios_build_settings(target), make sure to keep them

5
  • 1
    This worked for me but I had to keep this line: flutter_additional_ios_build_settings(target) Sep 17, 2022 at 22:47
  • 1
    I'd also check out these issues: issue 1 issue 2 Sep 18, 2022 at 7:40
  • This fixed the issue. What is causing this issue? Is the fix a workaround for an issue with flutter SDK or Xcode?
    – Justin
    Sep 18, 2022 at 19:23
  • @Justin no it's not a flutter issue, it is related to Xcode. I'm a native(swift) developer myself and I've faced the same issue Sep 18, 2022 at 20:02
  • 1
    I prefer this solution over the others, as this overcame the issue from Apple reviewers where they reject apps that have their pods' code signing skipped by using CODE_SIGNING_ALLOWED = NO. Feb 6 at 3:26
13

I'm wondering when Apple is going to launch a new xCode version without breaking anything from previous ones!

Rants aside, this is how I fixed my Flutter project based on previous answers:

Open your awesome_flutter_project/ios/Podfile:

and replace these lines:

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

for:

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
2
  • Mine worked only with your answer! The diff is: flutter_additional_ios_build_settings(target). Thanks!
    – Leonardo
    Sep 20, 2022 at 20:11
  • It did work well
    – Sithu
    Sep 24, 2022 at 6:58
9

Just for everyone, who thinks the accepted solution is a hack, you are right. This is a known bug in the flutter framework which has been fixed in flutter 3.3.3 .

So I recommand everyone to upgrade to this version, if you are able/allowed to do so.

In case you can't upgrade to 3.3.3 then the accepted solution is your best bet ;)

1
  • 1
    worked for me after upgrading to 3.3.3
    – Sp4Rx
    Oct 5, 2022 at 12:05
5

It's a Flutter framework issue

Update Flutter version into 3.3.3

4

I also got this error after updating XCode to version 14.

Add the following to ios > podfile

enter image description here

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

To get YOUR_DEVELOPMENT_TEAM_ID: https://developer.apple.com/account/#!/membership/

This will permanently fix the issue.

If you don't want to use the Team ID you can do this instead:

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
1

I was able to solve the problem by doing the following:

  1. Open project on xCode
  2. Open Pods and find out "GoogleSignIn-GoogleSignIn" and other three on Pods > Target
  3. Select Team on Signing & Capabilities
1
  • 4
    you will be required to do this every time after pod install Sep 16, 2022 at 16:09
1

Open your flutter project in Xcode

Pods -> Targets -> Signing & Capabilities -> Select Team

Select Team for every Targets

enter image description here

2
  • I simply tried running the app in xcode and then selected the development team for every lib it complained. Oct 14, 2022 at 13:11
  • It can work for local build, when you don't modify config, but with CI/CD like fastlane it is not working Dec 9, 2022 at 13:20
1

I am using CodeMagic.io (CI/CD) and had this same problem, I found the issue to be the Xcode version: 14

I solved this at CodeMagic.io by doing this :

  1. Go to the Workflow Editor
  2. Go to 'Build'
  3. Change the Xcode version: 13.4.1

If you are using another CI/CD try using Xcode version: 13.4.1

It was mentioned to solve this you can also update your Flutter version to 3.3.3 however if like me this is not an option for you try using Xcode version 13.4.1

1

adding following code solved issue in Xcode 14 and flutter version 2.8

        config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
0

When I put the the suggested changes in the pod file and run the flutter build ipa command, I am getting a different error.

Error:

 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>
1
  • Me too, Did you get a solution for that?
    – Mina Ayad
    Nov 8, 2022 at 11:51
0

For CI/CD, this is the only solution that worked for me. Update podfile.

       target_is_resource_bundle = target.respond_to?(:product_type) && target.product_type == 'com.apple.product-type.bundle'
       target.build_configurations.each do |build_configuration|
         if target_is_resource_bundle
           build_configuration.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
           build_configuration.build_settings['CODE_SIGNING_REQUIRED'] = 'NO'
           build_configuration.build_settings['CODE_SIGNING_IDENTITY'] = '-'
           build_configuration.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = '-'
         end
       end
0

enter image description here

then go to the team drop list and select your team

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.