Install native iOS pod in flutter

I am facing an error while making a flutter plugin on the iOS side while using pods. The pods are installed successfully then also I am able to import them in the file.

The pod in my case which I am trying to use is Freshchat iOS SDK

Steps I have followed to install the pod

  1. Start a new Flutter plugin project.
  2. In .podspec file add s.dependency 'FreshchatSDK'
  3. Run pod install in example/ios folder.

    I got an error

    The 'Pods-Runner' target has transitive dependencies that include statically linked binaries: (/Users/nimish/FlutterProjects/freshchat_flutter/freshchat_flutter/example/ios/Pods/FreshchatSDK/FreshchatSDK/libFDFreshchatSDK.a)

  4. I removed use_frameworks! from podfile following this comment .

  5. I ran pod install again and the pods were successfully installed and Pods folder was created which had FreshchatSDK folder in it.

Now I need to have use_frameworks! in my project because other plugins are not compiling because of this.

  1. I added s.static_framework = true in .podspec and use_frameworks! in podfile. Now pod install ran successfully,
  2. After I added the import #import "FreshchatSDK.h" in my Plugin.h file I got the error

    error: include of non-modular header inside framework module

I tried this answer but was not able to resolve it.

Please help me resolve this. I’ll be respectful of your time.

There is another flutter plugin available here but it has many issues and one unhandled case is making my iOS app crash so I want to make it my own.

Source: Ios