7

before you mark this question as a duplicate, I checked this question

and it didn't work for me.

how to fix this error:

error: SWIFT_VERSION '5.0' is unsupported, supported versions are: 3.0, 4.0, 4.2. (in target 'DropDown')
Dávid Pásztor
  • 51,403
  • 9
  • 85
  • 116
MhmdRizk
  • 1,591
  • 2
  • 18
  • 34
  • First Update Xcode after that Change language version Target->build setting -> Swift compiler language -> select 5, 4.2 etc. it will Work. – Ravindra_Bhati Apr 01 '19 at 09:59
  • 1
    I have many reasons, not to update Xcode to the new version, anyway I found an alternative solution, I updated my Podfile to downgrade the 'DropDown' Library. – MhmdRizk Apr 04 '19 at 08:12

4 Answers4

11

For XCode 10.1, select your Pods File

Select Pod

-> Go to Build Settings -> Choose your Pod -> Search "Swift" -> Navigate to "Swift Language version" -> Set to desired language version.

enter image description here

Deepak Chaudhary
  • 1,723
  • 1
  • 15
  • 29
7

You have code which was compiled on the new Xcode 10.2 or the beta version which supports Swift 5. Update your Xcode to the latest version.

Rakesha Shastri
  • 11,053
  • 3
  • 37
  • 50
0

After upgrading to Xcode 10.2 release make sure you reboot MacOS. I had the exact same problem and reboot helped.

Dan Korkelia
  • 104
  • 6
0

In addition to the correct answer, I added this to my podfile.

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '5.0'
      end
  end
end
MhmdRizk
  • 1,591
  • 2
  • 18
  • 34