flutter create a non-swift project
In pubspec.yaml, add a swift plugin such as flutter_iap.
flutter run warns about use_frameworks! from pod install. Easy to resolve so far.
- Building gives
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. error.
Seems like swift pod developers need to specify
s.pod_target_xcconfig = { 'SWIFT_VERSION' => <a version above 2.3 for it to work with Xcode 9> }
in their podspec. Added temporary hack in Podfile with
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.2'
end
end
end
and re-pod install
3.
#import "Headers/flutter_iap-umbrella.h"
^
.../ios/Pods/Target Support Files/flutter_iap/flutter_iap-umbrella.h:13:9: error: include of non-modular header inside framework module 'flutter_iap': '.../.pub-cache/hosted/pub.dartlang.org/flutter_iap-1.0.1/ios/Classes/FlutterIapPlugin.h'
Add
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
and
post_install do |installer|
installer.pods_project.targets.each do |target|
# workaround for https://github.com/CocoaPods/CocoaPods/issues/7463
target.headers_build_phase.files.each do |file|
file.settings = { 'ATTRIBUTES' => ['Public'] }
end
end
end
to make it work.
Wonder if we can add some automatic handling of swift plugins in the default objective-c project's Podfile
flutter createa non-swift projectIn
pubspec.yaml, add a swift plugin such asflutter_iap.flutter runwarns aboutuse_frameworks!frompod install. Easy to resolve so far.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.error.Seems like swift pod developers need to specify
s.pod_target_xcconfig = { 'SWIFT_VERSION' => <a version above 2.3 for it to work with Xcode 9> }in their podspec. Added temporary hack in Podfile with
and re-
pod install3.
Add
and
to make it work.
Wonder if we can add some automatic handling of swift plugins in the default objective-c project's Podfile