Command PhaseScriptExecution failed with a nonzero exit code for Xcode 14.1

I am trying to build iOS app on Mac M1 machine. I have Xcode 14.1 and Pod version 1.11.3. This code work well on my counter developer machine with M1 but when I check out code on my machine it throws an error. Please check attached screenshot. Here is the Pod :

platform :ios, '10.3'
target 'ParentappsConnect' do
 pod 'IQKeyboardManager'
 pod 'SVProgressHUD'
 pod 'Toast'
 pod 'UITextView+Placeholder'
 pod 'SDWebImage'
 pod 'KKPinCodeTextField'
 pod 'JMMaskTextField'
 pod "GSKStretchyHeaderView"
 pod 'UITextView+Placeholder'
 pod 'Firebase/Analytics'
 pod 'Firebase/Crashlytics'
 pod 'Firebase/Messaging'
# pod 'FSCalendar'
end

post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end
end

I have enabled the Rosetta for Xcode and not Terminal.

I tried with setting Rosetta for Terminal too. I got same issue.

Command PhaseScriptExecution failed with a nonzero exit code for Xcode 14.1
 
 
Q