Xcode 10.2, Swift 5, Command compileSwift failed while build the program with Release SchemeiOS: Pod Cache compile error with Swift 5 - Bus error: 10Command CompileSwiftSources failed with a nonzero exit code Xcode 10ld: framework not found PodsCocoapods for Swift, linker command failed for Release schemeUpdating to latest version of CocoaPods?Xcode 8.0 Swift 3.0 slow indexing and buildingBuild fails with “Command failed with a nonzero exit code”Xcode Jenkins Build Failure The following build commands failed: CompileSwift normal arm64Command CompileSwift failed with a nonzero exit code in Xcode 10Xcode 10 build fails with 'Command CompileSwift failed with a nonzero exit codeXcode 10.2.1 Command PhaseScriptExecution failed with a nonzero exit codeCommand CompileSwift failed with a nonzero exit code

What's the biggest organic molecule that could have a smell?

Georgian capital letter “Ⴒ” (“tar”) in pdfLaTeX

Do any aircraft carry boats?

How can I protect myself in case of a human attack like the murders of the hikers Jespersen and Ueland in Morocco?

Why should I always enable compiler warnings?

Did Picard get in trouble when he was in command of the Stargazer and lost his ship?

How can a resurrection system prevent the cheapening of death?

How does Vivi differ from other Black Mages?

Can I say "I have encrypted something" if I hash something?

Do all humans have an identical nucleotide sequence for certain proteins, e.g haemoglobin?

My research paper filed as a patent in China by my Chinese supervisor without me as inventor

My favorite color is blue what is your favorite color?

How to determine the traffic avoidance manuver?

Is BitLocker useful in the case of stolen laptop?

Should I use my toaster oven for slow roasting?

C++ - using const reference to prolong a member of a temporary, ok or UB?

Have there been any countries that voted themselves out of existence?

Kingdom Map and Travel Pace

Are the definite and indefinite integrals actually two different things? Where is the flaw in my understanding?

Were Roman public roads build by private companies?

A medieval fantasy adventurer lights a torch in a 100% pure oxygen room. What happens?

How to help my 2.5-year-old daughter take her medicine when she refuses to?

Writing a love interest for my hero

I changed a word from a source, how do I cite it correctly?



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


iOS: Pod Cache compile error with Swift 5 - Bus error: 10Command CompileSwiftSources failed with a nonzero exit code Xcode 10ld: framework not found PodsCocoapods for Swift, linker command failed for Release schemeUpdating to latest version of CocoaPods?Xcode 8.0 Swift 3.0 slow indexing and buildingBuild fails with “Command failed with a nonzero exit code”Xcode Jenkins Build Failure The following build commands failed: CompileSwift normal arm64Command CompileSwift failed with a nonzero exit code in Xcode 10Xcode 10 build fails with 'Command CompileSwift failed with a nonzero exit codeXcode 10.2.1 Command PhaseScriptExecution failed with a nonzero exit codeCommand CompileSwift failed with a nonzero exit code






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








16















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 hereenter image description here










share|improve this question


























  • can you please share the name of pods which you are using

    – shivi_shub
    Mar 26 at 7:25











  • try to remove the messed up pods from the Podfile and perform a pod install. ** if that doesn't work try: ** Clean and build the project. Add again the Pods to the Podfile and perform a pod install. Clean and build the project again using a real device if possible. ** try this if the above two dont work: ** make sure to Set Swift version to your current version then pod deintegrate, pod install, fix this

    – Sanad Barjawi
    Mar 26 at 7:27












  • Here are the pod list: Alamofire, Kingfisher, SwiftyJSON, SnapKit, SwifterSwift, LightBox @shivi_shub

    – Ran Bi
    Mar 26 at 7:38











  • # pod 'Alamofire' # pod 'Kingfisher' # pod 'SwiftyJSON' # pod 'SnapKit' pod 'DeviceKit' pod 'PKHUD' pod 'FMDB' # pod 'SwifterSwift' pod 'Tabman', '~> 2.2' pod 'FLEX', '~> 2.0' pod 'MJRefresh' pod 'UITextView+Placeholder' pod 'Bugly' # pod 'Lightbox' pod 'FSCalendar' pod 'RxSwift', '~> 4.0' pod 'RxCocoa', '~> 4.0' here are all the pods I'm using

    – Ran Bi
    Mar 26 at 7:40











  • i think one of your pod is not compatible with swift 5

    – shivi_shub
    Mar 26 at 9:01

















16















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 hereenter image description here










share|improve this question


























  • can you please share the name of pods which you are using

    – shivi_shub
    Mar 26 at 7:25











  • try to remove the messed up pods from the Podfile and perform a pod install. ** if that doesn't work try: ** Clean and build the project. Add again the Pods to the Podfile and perform a pod install. Clean and build the project again using a real device if possible. ** try this if the above two dont work: ** make sure to Set Swift version to your current version then pod deintegrate, pod install, fix this

    – Sanad Barjawi
    Mar 26 at 7:27












  • Here are the pod list: Alamofire, Kingfisher, SwiftyJSON, SnapKit, SwifterSwift, LightBox @shivi_shub

    – Ran Bi
    Mar 26 at 7:38











  • # pod 'Alamofire' # pod 'Kingfisher' # pod 'SwiftyJSON' # pod 'SnapKit' pod 'DeviceKit' pod 'PKHUD' pod 'FMDB' # pod 'SwifterSwift' pod 'Tabman', '~> 2.2' pod 'FLEX', '~> 2.0' pod 'MJRefresh' pod 'UITextView+Placeholder' pod 'Bugly' # pod 'Lightbox' pod 'FSCalendar' pod 'RxSwift', '~> 4.0' pod 'RxCocoa', '~> 4.0' here are all the pods I'm using

    – Ran Bi
    Mar 26 at 7:40











  • i think one of your pod is not compatible with swift 5

    – shivi_shub
    Mar 26 at 9:01













16












16








16


2






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 hereenter image description here










share|improve this question
















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 hereenter image description here







ios swift xcode cocoapods






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 26 at 9:15









k.s.

1,26512 silver badges16 bronze badges




1,26512 silver badges16 bronze badges










asked Mar 26 at 7:23









Ran BiRan Bi

811 silver badge5 bronze badges




811 silver badge5 bronze badges















  • can you please share the name of pods which you are using

    – shivi_shub
    Mar 26 at 7:25











  • try to remove the messed up pods from the Podfile and perform a pod install. ** if that doesn't work try: ** Clean and build the project. Add again the Pods to the Podfile and perform a pod install. Clean and build the project again using a real device if possible. ** try this if the above two dont work: ** make sure to Set Swift version to your current version then pod deintegrate, pod install, fix this

    – Sanad Barjawi
    Mar 26 at 7:27












  • Here are the pod list: Alamofire, Kingfisher, SwiftyJSON, SnapKit, SwifterSwift, LightBox @shivi_shub

    – Ran Bi
    Mar 26 at 7:38











  • # pod 'Alamofire' # pod 'Kingfisher' # pod 'SwiftyJSON' # pod 'SnapKit' pod 'DeviceKit' pod 'PKHUD' pod 'FMDB' # pod 'SwifterSwift' pod 'Tabman', '~> 2.2' pod 'FLEX', '~> 2.0' pod 'MJRefresh' pod 'UITextView+Placeholder' pod 'Bugly' # pod 'Lightbox' pod 'FSCalendar' pod 'RxSwift', '~> 4.0' pod 'RxCocoa', '~> 4.0' here are all the pods I'm using

    – Ran Bi
    Mar 26 at 7:40











  • i think one of your pod is not compatible with swift 5

    – shivi_shub
    Mar 26 at 9:01

















  • can you please share the name of pods which you are using

    – shivi_shub
    Mar 26 at 7:25











  • try to remove the messed up pods from the Podfile and perform a pod install. ** if that doesn't work try: ** Clean and build the project. Add again the Pods to the Podfile and perform a pod install. Clean and build the project again using a real device if possible. ** try this if the above two dont work: ** make sure to Set Swift version to your current version then pod deintegrate, pod install, fix this

    – Sanad Barjawi
    Mar 26 at 7:27












  • Here are the pod list: Alamofire, Kingfisher, SwiftyJSON, SnapKit, SwifterSwift, LightBox @shivi_shub

    – Ran Bi
    Mar 26 at 7:38











  • # pod 'Alamofire' # pod 'Kingfisher' # pod 'SwiftyJSON' # pod 'SnapKit' pod 'DeviceKit' pod 'PKHUD' pod 'FMDB' # pod 'SwifterSwift' pod 'Tabman', '~> 2.2' pod 'FLEX', '~> 2.0' pod 'MJRefresh' pod 'UITextView+Placeholder' pod 'Bugly' # pod 'Lightbox' pod 'FSCalendar' pod 'RxSwift', '~> 4.0' pod 'RxCocoa', '~> 4.0' here are all the pods I'm using

    – Ran Bi
    Mar 26 at 7:40











  • i think one of your pod is not compatible with swift 5

    – shivi_shub
    Mar 26 at 9:01
















can you please share the name of pods which you are using

– shivi_shub
Mar 26 at 7:25





can you please share the name of pods which you are using

– shivi_shub
Mar 26 at 7:25













try to remove the messed up pods from the Podfile and perform a pod install. ** if that doesn't work try: ** Clean and build the project. Add again the Pods to the Podfile and perform a pod install. Clean and build the project again using a real device if possible. ** try this if the above two dont work: ** make sure to Set Swift version to your current version then pod deintegrate, pod install, fix this

– Sanad Barjawi
Mar 26 at 7:27






try to remove the messed up pods from the Podfile and perform a pod install. ** if that doesn't work try: ** Clean and build the project. Add again the Pods to the Podfile and perform a pod install. Clean and build the project again using a real device if possible. ** try this if the above two dont work: ** make sure to Set Swift version to your current version then pod deintegrate, pod install, fix this

– Sanad Barjawi
Mar 26 at 7:27














Here are the pod list: Alamofire, Kingfisher, SwiftyJSON, SnapKit, SwifterSwift, LightBox @shivi_shub

– Ran Bi
Mar 26 at 7:38





Here are the pod list: Alamofire, Kingfisher, SwiftyJSON, SnapKit, SwifterSwift, LightBox @shivi_shub

– Ran Bi
Mar 26 at 7:38













# pod 'Alamofire' # pod 'Kingfisher' # pod 'SwiftyJSON' # pod 'SnapKit' pod 'DeviceKit' pod 'PKHUD' pod 'FMDB' # pod 'SwifterSwift' pod 'Tabman', '~> 2.2' pod 'FLEX', '~> 2.0' pod 'MJRefresh' pod 'UITextView+Placeholder' pod 'Bugly' # pod 'Lightbox' pod 'FSCalendar' pod 'RxSwift', '~> 4.0' pod 'RxCocoa', '~> 4.0' here are all the pods I'm using

– Ran Bi
Mar 26 at 7:40





# pod 'Alamofire' # pod 'Kingfisher' # pod 'SwiftyJSON' # pod 'SnapKit' pod 'DeviceKit' pod 'PKHUD' pod 'FMDB' # pod 'SwifterSwift' pod 'Tabman', '~> 2.2' pod 'FLEX', '~> 2.0' pod 'MJRefresh' pod 'UITextView+Placeholder' pod 'Bugly' # pod 'Lightbox' pod 'FSCalendar' pod 'RxSwift', '~> 4.0' pod 'RxCocoa', '~> 4.0' here are all the pods I'm using

– Ran Bi
Mar 26 at 7:40













i think one of your pod is not compatible with swift 5

– shivi_shub
Mar 26 at 9:01





i think one of your pod is not compatible with swift 5

– shivi_shub
Mar 26 at 9:01












6 Answers
6






active

oldest

votes


















7
















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






share|improve this answer

























  • Worded like a charm, thank you.

    – Ran Bi
    Apr 17 at 2:20











  • Worked for me..

    – czane
    Apr 24 at 21:45


















5
















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.






share|improve this answer

























  • This is working but building archive is taking too much time.

    – Olcay Ertaş
    Mar 28 at 9:13


















1
















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





share|improve this answer

























  • I've set all the target of Pod Project's Swift Language Version to 4.2 manually, as well as my own project, but still it won't work.

    – Ran Bi
    Mar 26 at 14:20


















1
















I had the same issue after upgrading to Xcode 10.2. After following the steps below it worked for me:



  1. Update pods

  2. Clean project folder

  3. Change Pods project's Swift Language Version to Unspecified and (as suggested by @Neil Faulkner) Compilation Mode to Incremental





share|improve this answer
































    1
















    I had to set "Optimization Level" in "Swift Compiler - Code Generation" to "Release" - "No Optimization [-Onone]" from "Optimize for speed" to make Cache pass Archive.



    Same with SwiftyBeaver



    It seems a problem related to Xcode 10.2. Also other pod projects seems to be fine with Optimization, like Toucan or XCGLogger.






    share|improve this answer
































      0
















      you can follow this steps...



      1. Make sure to change Swift version to your current version.

      2. Update all your pods.

      3. Clean all derived data of Xcode.

      4. Now Restart your Mac.

      You are getting all those error's just because of pods..so either you need to update every pod that you are using.






      share|improve this answer




















      • 1





        Thanks for answering, but I've tried all these steps, it didn't work for me.

        – Ran Bi
        Mar 26 at 7:50













      Your Answer






      StackExchange.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "1"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );














      draft saved

      draft discarded
















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55351736%2fxcode-10-2-swift-5-command-compileswift-failed-while-build-the-program-with-re%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      6 Answers
      6






      active

      oldest

      votes








      6 Answers
      6






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      7
















      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






      share|improve this answer

























      • Worded like a charm, thank you.

        – Ran Bi
        Apr 17 at 2:20











      • Worked for me..

        – czane
        Apr 24 at 21:45















      7
















      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






      share|improve this answer

























      • Worded like a charm, thank you.

        – Ran Bi
        Apr 17 at 2:20











      • Worked for me..

        – czane
        Apr 24 at 21:45













      7














      7










      7









      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






      share|improve this answer













      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







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Mar 29 at 11:43









      Olcay ErtaşOlcay Ertaş

      2,6956 gold badges57 silver badges88 bronze badges




      2,6956 gold badges57 silver badges88 bronze badges















      • Worded like a charm, thank you.

        – Ran Bi
        Apr 17 at 2:20











      • Worked for me..

        – czane
        Apr 24 at 21:45

















      • Worded like a charm, thank you.

        – Ran Bi
        Apr 17 at 2:20











      • Worked for me..

        – czane
        Apr 24 at 21:45
















      Worded like a charm, thank you.

      – Ran Bi
      Apr 17 at 2:20





      Worded like a charm, thank you.

      – Ran Bi
      Apr 17 at 2:20













      Worked for me..

      – czane
      Apr 24 at 21:45





      Worked for me..

      – czane
      Apr 24 at 21:45













      5
















      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.






      share|improve this answer

























      • This is working but building archive is taking too much time.

        – Olcay Ertaş
        Mar 28 at 9:13















      5
















      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.






      share|improve this answer

























      • This is working but building archive is taking too much time.

        – Olcay Ertaş
        Mar 28 at 9:13













      5














      5










      5









      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.






      share|improve this answer













      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.







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Mar 26 at 15:44









      Neil FaulknerNeil Faulkner

      3541 gold badge3 silver badges19 bronze badges




      3541 gold badge3 silver badges19 bronze badges















      • This is working but building archive is taking too much time.

        – Olcay Ertaş
        Mar 28 at 9:13

















      • This is working but building archive is taking too much time.

        – Olcay Ertaş
        Mar 28 at 9:13
















      This is working but building archive is taking too much time.

      – Olcay Ertaş
      Mar 28 at 9:13





      This is working but building archive is taking too much time.

      – Olcay Ertaş
      Mar 28 at 9:13











      1
















      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





      share|improve this answer

























      • I've set all the target of Pod Project's Swift Language Version to 4.2 manually, as well as my own project, but still it won't work.

        – Ran Bi
        Mar 26 at 14:20















      1
















      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





      share|improve this answer

























      • I've set all the target of Pod Project's Swift Language Version to 4.2 manually, as well as my own project, but still it won't work.

        – Ran Bi
        Mar 26 at 14:20













      1














      1










      1









      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





      share|improve this answer













      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






      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Mar 26 at 10:22









      DimillianDimillian

      2,1673 gold badges27 silver badges48 bronze badges




      2,1673 gold badges27 silver badges48 bronze badges















      • I've set all the target of Pod Project's Swift Language Version to 4.2 manually, as well as my own project, but still it won't work.

        – Ran Bi
        Mar 26 at 14:20

















      • I've set all the target of Pod Project's Swift Language Version to 4.2 manually, as well as my own project, but still it won't work.

        – Ran Bi
        Mar 26 at 14:20
















      I've set all the target of Pod Project's Swift Language Version to 4.2 manually, as well as my own project, but still it won't work.

      – Ran Bi
      Mar 26 at 14:20





      I've set all the target of Pod Project's Swift Language Version to 4.2 manually, as well as my own project, but still it won't work.

      – Ran Bi
      Mar 26 at 14:20











      1
















      I had the same issue after upgrading to Xcode 10.2. After following the steps below it worked for me:



      1. Update pods

      2. Clean project folder

      3. Change Pods project's Swift Language Version to Unspecified and (as suggested by @Neil Faulkner) Compilation Mode to Incremental





      share|improve this answer





























        1
















        I had the same issue after upgrading to Xcode 10.2. After following the steps below it worked for me:



        1. Update pods

        2. Clean project folder

        3. Change Pods project's Swift Language Version to Unspecified and (as suggested by @Neil Faulkner) Compilation Mode to Incremental





        share|improve this answer



























          1














          1










          1









          I had the same issue after upgrading to Xcode 10.2. After following the steps below it worked for me:



          1. Update pods

          2. Clean project folder

          3. Change Pods project's Swift Language Version to Unspecified and (as suggested by @Neil Faulkner) Compilation Mode to Incremental





          share|improve this answer













          I had the same issue after upgrading to Xcode 10.2. After following the steps below it worked for me:



          1. Update pods

          2. Clean project folder

          3. Change Pods project's Swift Language Version to Unspecified and (as suggested by @Neil Faulkner) Compilation Mode to Incremental






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 27 at 21:56









          cgontijocgontijo

          261 silver badge4 bronze badges




          261 silver badge4 bronze badges
























              1
















              I had to set "Optimization Level" in "Swift Compiler - Code Generation" to "Release" - "No Optimization [-Onone]" from "Optimize for speed" to make Cache pass Archive.



              Same with SwiftyBeaver



              It seems a problem related to Xcode 10.2. Also other pod projects seems to be fine with Optimization, like Toucan or XCGLogger.






              share|improve this answer





























                1
















                I had to set "Optimization Level" in "Swift Compiler - Code Generation" to "Release" - "No Optimization [-Onone]" from "Optimize for speed" to make Cache pass Archive.



                Same with SwiftyBeaver



                It seems a problem related to Xcode 10.2. Also other pod projects seems to be fine with Optimization, like Toucan or XCGLogger.






                share|improve this answer



























                  1














                  1










                  1









                  I had to set "Optimization Level" in "Swift Compiler - Code Generation" to "Release" - "No Optimization [-Onone]" from "Optimize for speed" to make Cache pass Archive.



                  Same with SwiftyBeaver



                  It seems a problem related to Xcode 10.2. Also other pod projects seems to be fine with Optimization, like Toucan or XCGLogger.






                  share|improve this answer













                  I had to set "Optimization Level" in "Swift Compiler - Code Generation" to "Release" - "No Optimization [-Onone]" from "Optimize for speed" to make Cache pass Archive.



                  Same with SwiftyBeaver



                  It seems a problem related to Xcode 10.2. Also other pod projects seems to be fine with Optimization, like Toucan or XCGLogger.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 31 at 12:12









                  An ChinAn Chin

                  3783 silver badges8 bronze badges




                  3783 silver badges8 bronze badges
























                      0
















                      you can follow this steps...



                      1. Make sure to change Swift version to your current version.

                      2. Update all your pods.

                      3. Clean all derived data of Xcode.

                      4. Now Restart your Mac.

                      You are getting all those error's just because of pods..so either you need to update every pod that you are using.






                      share|improve this answer




















                      • 1





                        Thanks for answering, but I've tried all these steps, it didn't work for me.

                        – Ran Bi
                        Mar 26 at 7:50















                      0
















                      you can follow this steps...



                      1. Make sure to change Swift version to your current version.

                      2. Update all your pods.

                      3. Clean all derived data of Xcode.

                      4. Now Restart your Mac.

                      You are getting all those error's just because of pods..so either you need to update every pod that you are using.






                      share|improve this answer




















                      • 1





                        Thanks for answering, but I've tried all these steps, it didn't work for me.

                        – Ran Bi
                        Mar 26 at 7:50













                      0














                      0










                      0









                      you can follow this steps...



                      1. Make sure to change Swift version to your current version.

                      2. Update all your pods.

                      3. Clean all derived data of Xcode.

                      4. Now Restart your Mac.

                      You are getting all those error's just because of pods..so either you need to update every pod that you are using.






                      share|improve this answer













                      you can follow this steps...



                      1. Make sure to change Swift version to your current version.

                      2. Update all your pods.

                      3. Clean all derived data of Xcode.

                      4. Now Restart your Mac.

                      You are getting all those error's just because of pods..so either you need to update every pod that you are using.







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Mar 26 at 7:46









                      AshishAshish

                      1013 bronze badges




                      1013 bronze badges










                      • 1





                        Thanks for answering, but I've tried all these steps, it didn't work for me.

                        – Ran Bi
                        Mar 26 at 7:50












                      • 1





                        Thanks for answering, but I've tried all these steps, it didn't work for me.

                        – Ran Bi
                        Mar 26 at 7:50







                      1




                      1





                      Thanks for answering, but I've tried all these steps, it didn't work for me.

                      – Ran Bi
                      Mar 26 at 7:50





                      Thanks for answering, but I've tried all these steps, it didn't work for me.

                      – Ran Bi
                      Mar 26 at 7:50


















                      draft saved

                      draft discarded















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55351736%2fxcode-10-2-swift-5-command-compileswift-failed-while-build-the-program-with-re%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                      용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

                      155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해