flutter_iap
flutter_iap copied to clipboard
The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift.
Hello,
Just added the plugin and got this error The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor.
Which Swift version should also be used?
I forget which one of these fixed the issue for me, but you can try the following: You also may need to run flutter clean and may also need to de-integrate the podfile and reinstall the pods. Sorry for the lack of specificity but one of these should do the trick!
- add use_frameworks!
target 'Runner' do
use_frameworks!
- pre_install
pre_install do |installer|
# workaround for https://github.com/CocoaPods/CocoaPods/issues/3289
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
end
- post_install
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'] = '3.2'
end
# workaround for https://github.com/CocoaPods/CocoaPods/issues/7463
target.headers_build_phase.files.each do |file|
file.settings = { 'ATTRIBUTES' => ['Public'] }
end
end
end
Edited for formatting
I finally updated the plugin. It should fix this issue. Let me know if it does.
Hey @JackAppDev , having the issue posted in #7.
Added
- add use_frameworks!
target 'Runner' do
use_frameworks!
Does the trick, thanks @evanave !
@alamboley could you open an issue in flutter's repo regarding plugins that use swift? I think this might be an issue they could fix.