[Fix] error build: Cannot code sign because the target does not have an Info.plist file and one is not being generated automatically

The problem “error build: Cannot code sign because the target does not have an Info.plist file and one is not being generated automatically.” is seen when you are working on XCode and have recently updated XCode to version 14, you will face this errro when you are trying to use cocoapods in your project of xcode.

Given below is the snippet of the issue:

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).

The problem, “error build: Cannot code sign because the target does not have an Info.plist file and one is not being generated automatically.” is seen because when you using xcode version 14, there is an issue with the latest update of xcode 14. The Cocoapods version being used in the latest version of XCode is the main culprit that error is shown.

To fix the issue, Go to the settings and set the CODE_SIGNING_ALLOWED to ‘NO’ for pod’s build setting to resolve the error. also need to add some lines of code in your project file to fix XCode 14 bundle sign in error.

Steps to Fix the problem “error build: Cannot code sign because the target does not have an Info.plist file and one is not being generated automatically.”:

To fix the error first you will have to fix the xcode bundle sigin by using the code mentioned below, you will have to copy and paste these lines of code in your project file and run again:

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

You can also try to make your own cocoapods plugin in your project file, as that is the file which is causing the error. You can use the link mentioned here to get your own cocoapods plugin, here.