'flutter build ios --release fatal error: module 'add_2_calendar' not found

I want to make a release for my project who work perefctly in dev mode.

When I make only flutter ios build it works fine
but flutter build ios --release doesn't work

the error message

youssefdahar@MacBook-Pro-van-Youssef devs % flutter build ios --release
Building com.example.mental for device (ios-release)...
Automatically signing iOS for device deployment using specified development team in Xcode project: X6BX32XBYP
Running pod install...                                           1 022ms
Running Xcode build...                                                  
 └─Compiling, linking and signing...                      1 163ms
Xcode build done.                                           47,6s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    Writing result bundle at path:
        /var/folders/n7/4j0kgb856bl9z75hy71rfmj80000gn/T/flutter_tools.TVo200/flutter_ios_build_temp_dirNtfcgE/temporary_xcresult_bundle

    /Users/youssefdahar/devs/ios/Runner/GeneratedPluginRegistrant.m:12:9: fatal error: module 'add_2_calendar' not found
    @import add_2_calendar;
     ~~~~~~~^~~~~~~~~~~~~~
    1 error generated.
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in dependency order

    Result bundle written to path:
        /var/folders/n7/4j0kgb856bl9z75hy71rfmj80000gn/T/flutter_tools.TVo200/flutter_ios_build_temp_dirNtfcgE/temporary_xcresult_bundle



It appears that your application still contains the default signing identifier.
Try replacing 'com.example' with your signing id in Xcode:
  open ios/Runner.xcworkspace
Encountered error while building for device.

I saw in the in the internet that i have to clean project and pod folder and file and reinstall, i tried many times but in vain

thanks in advance for your help



Solution 1:[1]

Finally I figured out that pod init and install doesn't work correctly because the file podfile generate by pod init is not the same as podfile generated by flutter run.

The solution is I deleted all pod file and folder and lock and ran flutter run once

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 marc_s