How to fix “SWIFT_VERSION '3.0' is unsuppo

2020-01-27 14:07发布

I'm trying to run downloaded from app, try to open in Xcode and have an error:

" Showing Recent Messages
:-1: SWIFT_VERSION '3.0' is unsupported, supported versions are: 4.0, 4.2, 5.0. (in target 'SimpleWeather')"

Screenshot added

11条回答
放荡不羁爱自由
2楼-- · 2020-01-27 14:28

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

查看更多
Melony?
3楼-- · 2020-01-27 14:30
  1. Select project
  2. Select Build SettingTab
  3. Select Swift Compiler language Option

enter image description here

查看更多
干净又极端
4楼-- · 2020-01-27 14:31

I came across this issue while developing a Cocoapod. I had an old .swift-version file in my repo that specified Swift 3.0.

Running pod lib lint --verbose led me to this helpful response:

Please remove the .swift-version file which is now deprecated and only use the swift_version attribute within your podspec.

I deleted the file and added spec.swift_version = '5.0' to my podspec file to fix the problem.

查看更多
仙女界的扛把子
5楼-- · 2020-01-27 14:32

enter image description hereselect pod like as per image and change swift language version this can save you one day

enter image description here

查看更多
迷人小祖宗
6楼-- · 2020-01-27 14:35

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.

查看更多
疯言疯语
7楼-- · 2020-01-27 14:37

******** 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

查看更多
登录 后发表回答