xcode 14
flutter 3.3.8
CocoaPods集成
1. 新建一个目录,目录内将要分别创建原生ios工程和flutter工程
2. 通过xcode创建ios工程
3. 创建flutter工程,project type要选择Module
4. 进入ios工程目录下执行pod init
如果报错 pod can't modify frozen String
执行 sudo gem install xcodeproj 或者 sudo gem update xcodeproj
5. 修改Podfile文件
flutter_application_path = '../[你的flutter工程目录]'
load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')
target '[你的ios项目名称]' do
use_frameworks!
install_all_flutter_pods(flutter_application_path)
end
post_install do |installer|
flutter_post_install(installer) if defined?(flutter_post_install)
end
6. 关闭 Xcode。然后打开你的app.xcworkspace,而不是app.xcodeproj