skip to Main Content

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.

7

Answers


  1. Chosen as BEST ANSWER

    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.


  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.

    Login or Signup to reply.
  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 🎉

    Login or Signup to reply.
  4. I had this same problem. What I did was

    1. Delete the Podfile and Podfile.lock
    2. flutter clean
    3. flutter build ios
    4. Opened the Runner.xcworkspace
    5. Build on Xcode

    This worked for me 🎉

    Login or Signup to reply.
  5. path/flutter/ios/Runner/GeneratedPluginRegistrant.m:12:9: Module 'app_settings' not found
    

    I had the same issue after upgrading the Xcode to 13.3 and my production build flavor wasn’t working. I was using firebase as well. In my production build flavor, I didn’t append anything to the configuration name (i.e. all the other configurations have the name like "Debug-staging", "Debug-development", but in the production, it’s only "Debug"). I just deleted the pod file and run:

    enter image description here

    flutter run –flavor production –target lib/main_production.dart

    Everything worked fine for me.

    Login or Signup to reply.
    1. Delete pod directory and podfile.lock
    2. flutter clean
    3. flutter pub get
    4. cd ios
    5. pod install –repo-update
    6. run the application in Xcode
    Login or Signup to reply.
  6. I tried everything above, but for me the solution was quite different.

    I am using flavors (schemes), and I accidentally created the scheme with upper case in the first character, while everywhere else (build config etc.) I used lower cases only. After deleting the scheme and recreating with lower case characters, it worked.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search