flutter_vibrate
flutter_vibrate copied to clipboard
Failed Build Swift Language Version
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
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!
andconfig.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
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.
I solved the problem by following steps:
- Add use_frameworks! and config.build_settings['SWIFT_VERSION'] = '5.0' to your Podfile.
- Delete the Podfile.lock in /ios directory.
- Open Runnner.xcworkspace, add an empty Swift file to the project and accept to add a bridging header file.
- Run 'flutter run'.