Repository navigation
Closed as not planned
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: first hourThe first hour of using FlutterThe first hour of using Fluttera: pluginsSupport for writing, building, and running plugin packagesSupport for writing, building, and running plugin packagesplatform-iosiOS applications specificallyiOS applications specificallyt: xcode"xcodebuild" on iOS and general Xcode project management"xcodebuild" on iOS and general Xcode project managementteam-iosOwned by iOS platform teamOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform teamTriaged by iOS platform team
Description
flutter create a non-swift project
In pubspec.yaml, add a swift plugin such as flutter_iap.
flutter runwarns aboutuse_frameworks!frompod 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
endand 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) {}
endand
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
endto make it work.
Wonder if we can add some automatic handling of swift plugins in the default objective-c project's Podfile
Reacted by Lukasz Piliszczuk, Koen Zwikstra, Mikkel Nygaard Ravn, Renato Athaydes, Gaëtan, Sergey Prymak, Rody Davis, Dark Chocolate, Iqbal, Jeremiah Ogbomo and 32 more
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: first hourThe first hour of using FlutterThe first hour of using Fluttera: pluginsSupport for writing, building, and running plugin packagesSupport for writing, building, and running plugin packagesplatform-iosiOS applications specificallyiOS applications specificallyt: xcode"xcodebuild" on iOS and general Xcode project management"xcodebuild" on iOS and general Xcode project managementteam-iosOwned by iOS platform teamOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform teamTriaged by iOS platform team
Activity
xster commentedon Mar 29, 2018
cc @mravn-google
pinkfish commentedon Apr 19, 2018
I tried these work arounds and it is still failing to build with the same error. Do I need to make any specific changes to the podfile that is being included or something too? I just did these in my app podfiles...
dlutton commentedon Apr 19, 2018
@pinkfish
Are you using cocoapods 1.5.0?
If so, try downgrading to 1.4.0. That's the only way I've been able to get it to work.
sudo gem install cocoapods -v 1.4.0
delete your Podfile.lock and Podfile dir in /ios and do a pod install
mravn-google commentedon Apr 19, 2018
@dlutton @pinkfish We have been unable to make Cocoapods 1.4.0 work all the way through to app store archives, and we'll be supporting only Cocoapods 1.5.0 or later going forward.
With Cocoapods 1.5.0 and newest Flutter tooling (on master), all you should have to do is patch your
Podfileas follows:Then delete
ios/Podfile.lockand executeflutter run.Filing issue that changing
ios/Podfiledoes not causeflutter runto redopod install#16734dlutton commentedon Apr 19, 2018
@mravn-google Tried cocoapods 1.5.0 and it's failing with:
mravn-google commentedon Apr 19, 2018
@dlutton Would you be able to share your
pubspec.yamlandios/Podfile?dlutton commentedon Apr 19, 2018
@mravn-google
Maybe it's my flutter_tts plugin I wrote in swift that's failing. It worked with cocoapods 1.4.
Podfile:
pubspec.yaml
mravn-google commentedon Apr 19, 2018
The
flutter_ttsplugin works fine when included in a Flutter project created using-i swift.mravn-google commentedon Apr 19, 2018
Adding an empty Swift file to your Flutter iOS project in Xcode and accepting to add bridging header also works.
dlutton commentedon Apr 19, 2018
Okay I’ll try that out thank you
dlutton commentedon Apr 19, 2018
@mravn-google I confirmed it's working with cocoapods 1.5.0. Thank you sir
goodis0 commentedon Jul 12, 2018
@mravn-google can you explain how to
Where am I creating this file and what is a bridging header?
lukepighetti commentedon Jul 25, 2018
@goodis0 Did you find an answer to this? Trying to add a pub package to a project I created with
Flutter: New Projectin Visual Studio Code and it's failing due toSWIFT_VERSIONerror being discussed.lukepighetti commentedon Jul 25, 2018
Can confirm that @mravn-google provided a simple and effective fix #16049 (comment)
66 remaining items
Fix file not found issue.
Fix file not found issue.
Update SoundpoolPlugin.m
stuartmorgan-g commentedon Mar 5, 2026
@vashworth Should we close this, given that it's about the Obj-C template and CocoaPods (neither of which is something we are investing further effort into)?
stuartmorgan-g commentedon Sep 23, 2026
Closing as obsolete; the Obj-C template no longer exists.
github-actions commentedon Oct 7, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.