简体   繁体   English

Can't build flutter ios with Firebase analytics running flutter build ios on codemagic.io cloud CI/CD

[英]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 .我已使用XCodeGoogleService-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>
  1. 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

  2. Delete Podfile inside ios folder of your flutter project.删除Podfile项目的 ios 文件夹中的 Podfile。

  3. Delete Podfile.lock inside ios folder of your flutter project.删除Podfile.lock项目的 ios 文件夹中的 Podfile.lock。

  4. Change the Deployment Target to 12.0将部署目标更改为12.0

  5. 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)

  6. Run your application and it should work运行您的应用程序,它应该可以工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM