0

So I've switched to Xcode 14, and it gave me a lot of compile errors, most of them were related to signing the internal frameworks (the app is well-modularized). While I've been doing that manually (updating about 70 modules), I felt bad as it's a waste of time, and the problem can happen again in the future.

I've found this thread where CODE_SIGN_STYLE=Manual is mentioned, but grep CODE_SIGN_STYLE -r . in a project folder gave me a lot CODE_SIGN_STYLE = Automatic; hits. Also, the checkbox Automatically manage signing is enabled for all of those modules. enter image description here

I guess it's Xcode14 bug, so all I wanted to ask:

  1. How have you solved this problem in case you've met it?
  2. Could I use some non-custom script like xcodesign-fix-team-for-automatic-signing --team MY_TEAM_ID to do it in 1 click?

UPD: I've found such strings in project.pbxproj files those "broken" modules:

                "CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
                "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
                "CODE_SIGN_IDENTITY[sdk=watchos*]" = "";

But after I manually update the Team in Signing tab, that CODE_SIGN_IDENTITY[sdk=iphoneos*] value is still empty.

olha
  • 2,132
  • 1
  • 18
  • 39

2 Answers2

0

Solution which worked for me (just added that phase to Podfile):

post_install do |installer|
  installer.generated_projects.each do |project|
    project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings["DEVELOPMENT_TEAM"] = " Your Team ID  "
         end
    end
  end
end

I've found it in the CocoaPods issue, which is identical to my problem.

Before that, I tried to find DEVELOPMENT_TEAM/DevelopmentTeam/Team in the .pbxproj files of individual modules using this advice. But as there was no team specified, it became obvious that this is a CocoaPods issue.

olha
  • 2,132
  • 1
  • 18
  • 39
0

A solution without specifing the team id. Good for generic copy-paste.

post_install do |installer|
    # get team-id from project's first target
    dev_team = ""
    project = installer.aggregate_targets[0].user_project
    project.targets.each do |target|
        target.build_configurations.each do |config|
            if dev_team.empty? and !config.build_settings['DEVELOPMENT_TEAM'].nil?
                dev_team = config.build_settings['DEVELOPMENT_TEAM']
                break
            end
        end
    end
  
    # Apply team-id
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings["DEVELOPMENT_TEAM"] = dev_team
        end
    end
end

Inspired from: https://www.jianshu.com/p/685b32c3d521

Benny Davidovitz
  • 1,152
  • 15
  • 18