Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

472
Views
Xcode 10.2, Swift 5, Command compileSwift failed while build the program with Release Scheme

I'm using Xcode 10.2, Swift 5.

With Debug scheme, no issue happens, but with Release scheme when I build or archive, it shows Command compileSwift failed with a nonzero exit code.

I've tried delete DerivedData / Clean / pod deintegrate & pod install & pod update. None of these works.

enter image description here enter image description here

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

For my project problem was related to pod Cache which gives error when Optimization Level for Release is set to Optimize for Speed [-O]. I have set Compilation Mode to Whole Module again and set optimization level for the pod in pod file:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    # Cache pod does not accept optimization level '-O', causing Bus 10 error. Use '-Osize' or '-Onone'
    if target.name == 'Cache'
      target.build_configurations.each do |config|
        level = '-Osize'
        config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = level
        puts "Set #{target.name} #{config.name} to Optimization Level #{level}"
      end
    end
  end
end

Refrence: https://github.com/hyperoslo/Cache/issues/233#issuecomment-477749560

over 4 years ago · Santiago Trujillo Report

0

I fixed this issue by going Pods Project then to the building settings and setting Compilation Mode to Incremental for Release. Then clean and archive, should compile fine then.

over 4 years ago · Santiago Trujillo Report

0

So I had same issue when updating my project to Swift 5. For some reason, Cocoapods (latest version, 1.6.1) set the SWIFT_VERSION of some pods to Swift 5 even if they're released as Swift 4, 4.1, 4.2 pods. So I had to add a post install script that set the correction version of swift like so

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == 'CryptoSwift' || target.name == 'SwiftyBeaver'
      target.build_configurations.each do |config|
        config.build_settings['SWIFT_VERSION'] = '4.2'
      end
    end
  end
end
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!