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

1,032

OK the answer from @Ashok was a good start. After you delete the old Podfile and other stuff, you run pod install and a new Podfile is created. 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

  <key>MinimumOSVersion</key>
  <string>9.0</string>
Share:
1,032
Mark
Author by

Mark

Updated on December 29, 2022

Comments

  • Mark
    Mark over 1 year

    I have added GoogleService-Info.plist to ios\Runner using XCode.

    I created this Podfile

    platform :ios, '10.0'
    
    target 'Runner' do
      #use_frameworks!
      pod 'Firebase/Core'
      pod 'Firebase/Analytics'
    end
    

    pubspec.yaml has

      firebase_core: ^1.0.2
      firebase_analytics: ^7.1.1
    

    Still get this error building on 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!!

    • Ashok
      Ashok about 3 years
      Try removing use_frameworks! from ios/Podfile, and see if that works
    • Mark
      Mark about 3 years
      it's already #d thanks
  • Mark
    Mark about 3 years
    Thanks, but please note I am building this on codemagic.io CI/CD so its running a clean build each time (no DerivedData or Podfile.lock)
  • Mark
    Mark about 3 years
    Also I thought 10.0 is enough for Firebase analytics no? Thanks again