1

GeneratedPluginRegistrant.m

As you can see in the GeneratedPluginRegistrant.m file, I am trying to import my plugins and I tried many times to fix it using these command:

main: flutter clean

main: flutter pub get

iOS: pod deintegrate

iOS: pod install

iOS: pod install clear cache --all

In Xcode, Clean pod build folder, but not yet get any solution.

When I fix on the plugin issue (if i am removing then it's showing me another plugin issue, but it is same as the first. If I removed plugins from my pubspec.yaml file then it's also showing this issue. How can I solve this issue?

// Generated file. Do not edit.

// clang-format off

#import "GeneratedPluginRegistrant.h"

#if __has_include(<cloud_firestore/FLTFirebaseFirestorePlugin.h>)
#import <cloud_firestore/FLTFirebaseFirestorePlugin.h>
#else
@import cloud_firestore;  Error is here -> Module 'cloud_firestore' not found
#endif

#if __has_include(<connectivity/FLTConnectivityPlugin.h>)
#import <connectivity/FLTConnectivityPlugin.h>
#else
@import connectivity;
#endif

#if __has_include(<contact_picker/ContactPickerPlugin.h>)
#import <contact_picker/ContactPickerPlugin.h>
#else
@import contact_picker;
#endif

#if __has_include(<device_info/FLTDeviceInfoPlugin.h>)
#import <device_info/FLTDeviceInfoPlugin.h>
#else
@import device_info;
#endif

#if __has_include(<file_picker/FilePickerPlugin.h>)
#import <file_picker/FilePickerPlugin.h>
#else
@import file_picker;
#endif

#if __has_include(<firebase_auth/FLTFirebaseAuthPlugin.h>)
#import <firebase_auth/FLTFirebaseAuthPlugin.h>
#else
@import firebase_auth;
#endif

#if __has_include(<firebase_messaging/FLTFirebaseMessagingPlugin.h>)
#import <firebase_messaging/FLTFirebaseMessagingPlugin.h>
#else
@import firebase_messaging;
#endif

#if __has_include(<firebase_remote_config/FirebaseRemoteConfigPlugin.h>)
#import <firebase_remote_config/FirebaseRemoteConfigPlugin.h>
#else
@import firebase_remote_config;
#endif

#if __has_include(<flutter_downloader/FlutterDownloaderPlugin.h>)
#import <flutter_downloader/FlutterDownloaderPlugin.h>
#else
@import flutter_downloader;
#endif
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131

1 Answers1

-4

While "module not found" issue in a Flutter project when using Xcode. This issue typically arises when Flutter plugins or dependencies are not properly integrated with the iOS side of the project. Follow these steps to resolve the problem:

flutter clean

This command is used to remove any temporary files, caches, and build artifacts generated by Flutter. Running this command ensures a clean build environment for your project, which can help in resolving certain issues.

gem install cocoapods --user-install

This command installs the cocoapods gem locally in your user directory, which allows you to manage and install CocoaPods dependencies without requiring administrative privileges. The --user-install flag ensures that the gem is installed in a directory where you have write permissions, avoiding potential permission issues.

pod repo update

This command updates the local CocoaPods repositories. CocoaPods is a dependency manager for iOS projects, and it uses various repositories to fetch the required dependencies. By running pod repo update, you ensure that the dependency information is up-to-date, which can help in resolving issues related to missing or outdated dependencies.

pod install

This command is used to install the CocoaPods dependencies specified in the Podfile. The Podfile is a configuration file used by CocoaPods to define the dependencies required by the iOS part of your Flutter project. By running pod install, you ensure that all the specified dependencies are downloaded and integrated into your Xcode project.

By following these steps, you are addressing potential issues related to dependencies and project configurations, which can help in resolving the "module not found" issue in your Flutter project when working with Xcode. After completing these steps, try building and running your project again to see if the issue is resolved.

Akash Shah
  • 43
  • 4
  • 2
    Welcome back to Stack Overflow, Akash Shah. It looks like it's been a while since you've posted and may not be aware of the latest policies since your answer appears likely to have been entirely or partially written by AI (e.g., ChatGPT). As a heads-up, [posting of AI-generated content is not permitted on Stack Overflow](//meta.stackoverflow.com/q/421831). If you used an AI tool to assist with any answer, I would encourage you to delete it. We do hope you'll stick around and continue to be a valuable part of our community by posting *your own* quality content. Thanks! – NotTheDr01ds Aug 06 '23 at 16:52
  • 1
    **Readers should review this answer carefully and critically, as AI-generated information often contains fundamental errors and misinformation.** If you observe quality issues and/or have reason to believe that this answer was generated by AI, please leave feedback accordingly. – NotTheDr01ds Aug 06 '23 at 16:52
  • @NotTheDr01ds: Agreed. The writing style, etc. is totally out of whack with all [the other answers](https://stackoverflow.com/users/13618194/akash-shah?tab=answers) (in their first (initial) revisions). (This one seems to be the only one generated by ChatGPT.) – Peter Mortensen Aug 07 '23 at 09:29