15

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.

Community
  • 1
  • 1
nimi0112
  • 2,065
  • 1
  • 18
  • 32

1 Answers1

1

There may be problems in the PodFile due to unmatched Targets. When this happens to me, I used these simple steps.

  1. Delete Podfile
  2. Open Terminal at the specific file
  3. Pod init
  4. Open Podfile and adds Dependencies
  5. Pod install
Matrix
  • 59
  • 2