Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed Build Swift Language Version #11

Open
edeuss opened this issue Oct 26, 2018 · 3 comments
Open

Failed Build Swift Language Version #11

edeuss opened this issue Oct 26, 2018 · 3 comments

Comments

@edeuss
Copy link

edeuss commented Oct 26, 2018

Here is the error: Xcode's output: ↳ 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.

This would be helpful if this is fixed fast thanks

@dmjones
Copy link

dmjones commented Oct 29, 2018

I solved it by following the instructions in this StackOverflow answer. (I used 4.2 for the Swift version). Quoting that answer:

When the iOS part of a plugin is coded using Swift, you must make that change to your ios/Podfile. You must add use_frameworks! and config.build_settings['SWIFT_VERSION'] = '4.1'.

target 'Runner' do
  use_frameworks!  # required by simple_permission
  ...
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '4.1'  # required by simple_permission
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

@sjschnuggsr
Copy link

Made the additions to Podfile as per Duncan Jones above but build still fails on ios with this error:

- `vibrate` does not specify a Swift version and none of the targets (`Runner`) integrating it have the `SWIFT_VERSION` attribute set. Please contact the author or set the `SWIFT_VERSION` attribute in at least one of the targets that integrate this pod.

@tamarous
Copy link

I solved the problem by following steps:

  1. Add use_frameworks! and config.build_settings['SWIFT_VERSION'] = '5.0' to your Podfile.
  2. Delete the Podfile.lock in /ios directory.
  3. Open Runnner.xcworkspace, add an empty Swift file to the project and accept to add a bridging header file.
  4. Run 'flutter run'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants