Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

flutter: fatal error: module 'firebase_analytics' not found

After adding firebase dependency on iOS, when I want to run then I get this error

Xcode's output:
↳
    ../ios/Runner/GeneratedPluginRegistrant.m:10:9: fatal error: module
    'firebase_analytics' not found
    @import firebase_analytics;
     ~~~~~~~^~~~~~~~~~~~~~~~~~
    1 error generated.
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

Could not build the precompiled application for the device.

Error launching application on Abir's iPhone.

I already tried many way. like delete pod file, pod update, pod install etc.

like image 513
Abir Ahsan Avatar asked Jun 09 '26 07:06

Abir Ahsan


2 Answers

Its problem with openning Runner. Open Runner.xcworkspace not Runner.xcodeproj.enter image description here

like image 82
Misho M. Petkovic Avatar answered Jun 10 '26 20:06

Misho M. Petkovic


I had this same error and here is how to solve it.

  1. Delete the DerivedData from Xcode folder. Open Runner.xcworkspace inside the ios folder of your flutter project then click File -> Workspace Settings -> Click the grey arrow beside DerivedData path and delete the DerivedData inside the Xcode folder. enter image description here

enter image description here

  1. Delete both Podfile and Podfile.lock files inside ios folder of your flutter project.
  2. Change the Deployment Target to 12.0. You will find the Deployment Target under General -> Deployment Info.

enter image description here

  1. Clean your ios build folder.

enter image description here

  1. Run your app (it will generate a new podfile, do not edit this podfile) It should work.
like image 44
Frankdroid7 Avatar answered Jun 10 '26 22:06

Frankdroid7