How to fix "SWIFT_VERSION '3.0' is unsupported, supported versions are: 4.0, 4.2, 5.0" error in Xcode 10.2?

Solution 1:

Select the target 'SimpleWeather' in the project and change language version Target->build setting -> Swift compiler language -> select 5, 4.2 etc

image of build setting for changing compiler language

Solution 2:

******** Easiest way: **********

1.Click on PODs in the left column.

2.In the centre column select the pod you want, then navigate to "build settings" in the top right panel.

3.Then search "Swift Language Version" and change to a known version.

enter image description here enter image description here

Solution 3:

For Xcode 10.1, select your Pods File

enter image description here

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

enter image description here

Solution 4:

I followed the instructions on this page and the error didn't resolve. Finally, went into

$ vim MyProject.xcodeproj/project.pbxproj

and found two instances where

SWIFT_VERSION = 3.0;

was still being referenced. I changed those to 5.0 and the error was gone. Not sure why those two were still there.