importing "Module 'app_settings'" not found

4,289

Solution 1

Hmm Not sure what happened but it seems to be good now. I think pod init was initializing minimal data for the podfile. Instead, I deleted the Pods file and did flutter run and it built the podfile correctly with flutter pub get.

Solution 2

My project has 3 build flavor. Development, Staging & Production.

In Xcode It was selected default Runner One. (On Top of the middle)

though i follow the process like

  • delete pod , Podfile.lock and .symlinks from Android Studio / (From Project)
  • flutter pub get
  • cd ios > pod install
  • Then In XCode > clean build
  • Select Right Build Flavor (Production For Me)
  • Then Archive (Done)

NB: I tested in M1 machine.

Solution 3

Had the same problem, we solved it by setting the iOS Deployment target in XCode to the same value as set in the Podfile, which was 12.0. Then ran flutter clean and flutter build ios worked like a charm 🎉

Share:
4,289
jstoe
Author by

jstoe

Updated on December 12, 2022

Comments

  • jstoe
    jstoe over 1 year

    I'm currently trying to work with xcode to test my flutter application with xcode. The big issue is that all of my imports (such as app_settings, cloud_firestore, etc...) give an error for "Module ___ not found". When I try to run my dart code I get the error in the terminal:

    [Proj Root]/ios/Runner/GeneratedPluginRegistrant.m:10:9: fatal error: module 'app_settings' not found
    @import app_settings;
    ~~~~~~~~^~~~~~~~~~~~
    1 error generated.
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
    

    I tried running flutter create for ios, (this might've made things worse?) Flutter clean and reinstalling pods doesn't seem to work either. I'm wondering if there's something simple that I missed with importing modules. I created the application on android using modules that should work with Android & iOS. After getting the android version working I pulled my project on my mac through github and finally reached this issue. Any pointers would be appreciated because I'm totally stuck on this.

    • chichi
      chichi over 2 years
      did you find the solution? This works on my iPhone but not on the simulator
    • jstoe
      jstoe over 2 years
      Yeah, the solution for me was to delete the Pods file and do Flutter run -> flutter pub get. Hopefully that helps
  • Waqas Younis
    Waqas Younis over 2 years
    Hey, I tried everything but not working, actually, I am on M1, so you got any solution for me?
  • jstoe
    jstoe over 2 years
    The only solution I had was the clear out all the old pods files and have flutter rebuild them with flutter run -> flutter pub get Hope that helps