Skip to content

Command PhaseScriptExecution failed with a nonzero exit code #12209

@harikishan-d

Description

@harikishan-d

Report

What did you do?

ℹ After Updating to Xcode 15.1 & CocoaPods 1.14.3

What did you expect to happen?

ℹ Xcode project build & archive should be succeed

What happened instead?

ℹ getting an error while archiving
Command PhaseScriptExecution failed with a nonzero exit code

CocoaPods Environment

ℹ Please replace these two lines with the output of pod env.

Stack

   CocoaPods : 1.14.3
        Ruby : ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.x86_64-darwin23]
    RubyGems : 3.0.3.1
        Host : macOS 14.2 (23C64)
       Xcode : 15.1 (15C65)
         Git : git version 2.39.3 (Apple Git-145)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/

Installation Source

Executable Path: /usr/local/bin/pod

Plugins

cocoapods-deintegrate : 1.0.5
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.1
cocoapods-stats       : 1.1.0
cocoapods-trunk       : 1.6.0
cocoapods-try         : 1.2.0

Podfile

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'Project’ do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!
  
pod 'MKDropdownMenu'
pod 'LinearProgressBar'
pod 'CocoaAsyncSocket'
post_install do |installer|
  
  installer.pods_project.targets.each do |target|
          # Fix libarclite_xxx.a file not found.
          target.build_configurations.each do |config|
              config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
          end
      end
  # Check if Xcode version is 14.3
  xcode_version = `xcodebuild -version | grep "Xcode" | awk '{print $2}'`.strip
  required_version = "14.3"

  if xcode_version == required_version
    puts "Checking and fixing Pods for Xcode 14.3 if needed..."

    file = 'Pods/Target Support Files/Pods-APPNAME/Pods-APPNAME-frameworks.sh'

    if File.exist?(file)
      content = File.read(file)

      if !content.include?('source="$(readlink -f "${source}")"')
        fixed_content = content.gsub('source="$(readlink "${source}")"', 'source="$(readlink -f "${source}")"')
        File.write(file, fixed_content)
        puts "Fixed file: #{file}"
      else
        puts "No fix needed for file: #{file}"
      end
    else
      puts "File not found: #{file}"
    end

  else
    puts "Xcode version is not 14.3, no action required."
  end
end
end

Project that demonstrates the issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions