1

I'm building a flutter app. everyting worked just fine. Then I think dart was upgraded and suddenly the build of the app fails with this error:

The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. Supported values are: 3.0, 4.0, 4.2. This setting can be set in the build settings editor.

I don't see the setting in xcode and not sure what caused this error. Anyone else seen it?

2

1 Answer 1

5

For anyone else looking for the solution. You need to have XCode version higher than 10.0 before you can use Swift 4.2.

Open your podfile and make the following changes

target 'Runner' do use_frameworks! # <---- // 1st add this right below above line ... end post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['ENABLE_BITCODE'] = 'NO' config.build_settings['SWIFT_VERSION'] = '4.2' # <--- // 2nd add this end end end 

After this, in terminal use flutter run. More info

Sign up to request clarification or add additional context in comments.

1 Comment

Exactly the same changes I did

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.