Xcode 14 - Cannot code sign because the target does not have an Info.plist file
Asked Answered
V

6

18

I am using cocoapods in my project and it was working fine but after upgrade to Xcode 14 it is giving different kind or errors.

Firstly it was asking for bit code and later asked for the development team which I resolved using following script in podfile

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      #config.build_settings['BITCODE_GENERATION_MODE'] = 'bitcode'
      config.build_settings['ENABLE_BITCODE'] = 'YES'
      config.build_settings["DEVELOPMENT_TEAM"] = " Your Team ID "
    end
  end
end

After resolving those error another one has started to appear i.e.

error build: Cannot code sign because the target does not have an Info.plist file and one is not being generated automatically. Apply an Info.plist file to the target using the INFOPLIST_FILE build setting or generate one automatically by setting the GENERATE_INFOPLIST_FILE build setting to YES (recommended).

my pods are updated and cocoa pod version is 1.11.3. How can i resolve this error?

EDIT:

Some details are mentioned here but none is working for me.

Vogue answered 15/9, 2022 at 10:38 Comment(3)
#Added for resolving xcode 14 cocoapods post_install do |installer| installer.pods_project.targets.each do |target| 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 I have added above in pod file just before the last end of pod file.Vogue
Further I have disabled the bitcode in my projects as it is not required now in most of the cases. Apple have removed it as required. I was using bit code for Dsym symbols which do not require bitcode for now. You can check details #72544228Vogue
@hassy The solutions below (even the top answer as of April 2024) won't persist in source control (if you have your Pods directory .gitignored), but mine will! https://mcmap.net/q/649853/-xcode-14-cannot-code-sign-because-the-target-does-not-have-an-info-plist-fileSnowflake
Z
39

I Solved it making this change:

Pods -> Build Settings -> Packaging -> Generate Info.plist File = Yes

Zoo answered 4/1, 2023 at 18:2 Comment(3)
I had a similar issue and also had to do the same thing on the app project, selecting the specific build target (also select the "All" tab and use the filter box if having a hard time finding the "Generate Info.plist File" item). Changing these settings adds GENERATE_INFOPLIST_FILE = YES; lines to the .pbxproj files that can be committed.Chela
@Engr.AftabUfaqey, sorry for late response... to solve that error you need upgrade your project because React-codegen have some issues, solved in 0.70.8 and in Podfile add this in post install: installer.pods_project.targets.each do |t| t.build_configurations.each do |config| config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO' end endZoo
The solution above does not work well if your Pods directory is gitignored, but this one will https://mcmap.net/q/649853/-xcode-14-cannot-code-sign-because-the-target-does-not-have-an-info-plist-fileSnowflake
L
6

This hack(i.e. setting CODE_SIGNING_ALLOWED to NO for pod's build setting) fixed for me.

Lau answered 27/9, 2022 at 2:40 Comment(0)
B
5

Sometimes a picture clarifies things that are hard to describe in words. You can enable "Generate Info.plist File" for both Debug and Release, under the Build Settings, Packaging.

enable Generate Info.plist file for both Debug and Release

Both answered 6/2, 2024 at 1:10 Comment(2)
Perfect solution, this helps me to solve the issue. Thank youSenseless
It goes back to "NO" each time I do a pod install, how can I avoir that ?Hanshansard
R
4

In my case I solved it adding the Info.plist path to: Pods -> Build Settings -> Packaging -> Info.plist File

Roman answered 31/10, 2022 at 13:34 Comment(1)
Within Xocde, on the left navigation, select "Pods", then in the main section of XCode, Select Build Settings --> Packaging --> Generate info.plist File = YesPegasus
S
1

Since we don't have our Pods.xcproject tracked in git, I decided to make the modification that others are suggesting via the Podfile, since it is checked in.

  post_install do |installer|
    
    installer.generated_projects.each do |project|
      if project.path.basename.to_s == 'Pods.xcodeproj'
        project.build_configurations.each do |config|
          config.build_settings['GENERATE_INFOPLIST_FILE'] = 'YES'
        end
        project.save
      else
        puts "Skipping project #{project.path.basename}"
      end
    end
  end # post_install

This does the same thing as manually setting that value in the Xcode GUI, but makes it so that any time you do another pod install, you'll still get the setting you need.

Snowflake answered 11/4, 2024 at 16:16 Comment(0)
U
0

All the above solution not worked for me. the final solution that had worked for me is that. Pod -> Build Setting -> Generate Info.plist to NO And React-Codegen to YES

Undeceive answered 7/6, 2023 at 9:34 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.