Undefined Symbol: _swift_FORCE_LOAD$_swiftCompatibility56 When Building Flutter iOS App with CocoaPods

I am encountering an error when trying to build my Flutter iOS app for the simulator using CocoaPods. The build fails with the following error message:

bash

Copier le code

Error (Xcode): Undefined symbol: __swift_FORCE_LOAD_$_swiftCompatibility56
Could not build the application for the simulator.

Despite following the recommended steps to resolve this issue, the error persists.

Environment

  • Flutter Version: 3.22.2
  • Xcode Version: 14.2.0
  • CocoaPods Version: 1.11.2
  • iOS Deployment Target: 15.0
  • Swift Version: 5.0

Steps Taken to Resolve the Issue:

  1. Updated iOS Deployment Target to 15.0:
  • Modified Podfile to set platform :ios, '15.0'.
  • Updated Xcode project settings to set iOS Deployment Target to 15.0.
  1. Cleaned and Reinstalled Dependencies:
  • Ran flutter clean.
  • Deleted Pods and Podfile.lock.
  • Ran pod install.
  1. Verified Compatibility of Dependencies:
  • Checked all dependencies to ensure they are compatible with Swift 5 and iOS 15.0.
  1. Modified Build Settings in Xcode:
  • Ensured Swift Language Version is set to 5.0.
  • Added $(inherited) to Framework Search Paths and Other Linker Flags.

Despite these steps, the issue persists. Any help or suggestions would be greatly appreciated.

Error Logs:

Error (Xcode): Undefined symbol: __swift_FORCE_LOAD_$_swiftCompatibility56
Could not build the application for the simulator.

Thank you for your assistance!

You might have better luck asking this over at the Apple developer forums or somewhere appropriate to CocoaPods.

Hi @polo8619 By any chance did you resolve this issue . Please suggest the solution . I am struggling with same error with same versions mentioned above feom past 3 weeks . No solution yet .

I'm facing the same issue, and only when I set the deployment target to 13.4 and above.
The app still works with deployment target 13.3 and below. So I now stuck with 13.3 and below.
Is there anyone fixed this problem?