[英]Can't build flutter ios with Firebase analytics running flutter build ios on codemagic.io cloud CI/CD
I have added GoogleService-Info.plist
to ios\Runner
using XCode .我已使用XCode将GoogleService-Info.plist
添加到ios\Runner
。
I created this Podfile我创建了这个Podfile
platform :ios, '10.0'
target 'Runner' do
#use_frameworks!
pod 'Firebase/Core'
pod 'Firebase/Analytics'
end
pubspec.yaml has pubspec.yaml有
firebase_core: ^1.0.2
firebase_analytics: ^7.1.1
Still get this error building on https://codemagic.io/在https://codemagic.io/上仍然出现此错误
Xcode's output:
/Users/builder/clone/ios/Runner/GeneratedPluginRegistrant.m:10:9: fatal error: module 'firebase_analytics' not found
@import firebase_analytics;
Thanks!!谢谢!!
OK the answer from @Ashok was a good start.好的,@Ashok 的回答是一个好的开始。 After you delete the old Podfile and other stuff, you run pod install
and a new Podfile
is created.删除旧的 Podfile 和其他内容后,运行pod install
并创建一个新的Podfile
。 You need to add您需要添加
platform :ios, '9.0' #uncomment this
and和
target 'Runner' do
use_frameworks!
use_modular_headers!
pod 'Firebase/Analytics', '~> 7.3.0' #Highest pod version that works with flutter firebase_analytics: ^7.1.1
...
Also in AppFrameworkInfo.plist
add/edit同样在AppFrameworkInfo.plist
添加/编辑
<key>MinimumOSVersion</key>
<string>9.0</string>
Delete the DerivedData
from Xcode
folder.从Xcode
文件夹中删除DerivedData
。
Open Runner.xcworkspace
inside the ios folder of your flutter project then select在 flutter 项目的 ios 文件夹中打开Runner.xcworkspace
,然后打开 select
File -> Workspace Settings ->
Click the grey arrow beside DerivedData
path and delete the DerivedData
inside the Xcode
folder. File -> Workspace Settings ->
单击DerivedData
路径旁边的灰色箭头,然后删除DerivedData
文件夹中的Xcode
。
Delete Podfile
inside ios folder of your flutter project.删除Podfile
项目的 ios 文件夹中的 Podfile。
Delete Podfile.lock
inside ios folder of your flutter project.删除Podfile.lock
项目的 ios 文件夹中的 Podfile.lock。
Change the Deployment Target to 12.0
将部署目标更改为12.0
Clean your ios build folder (Command+Option+Shift+K)
Or from the menu -> Product
, press Option on your keyboard and you'll see Clean Build Folder
清理menu -> Product
构建文件Clean Build Folder
(Command+Option+Shift+K)
Run your application and it should work运行您的应用程序,它应该可以工作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.