2

So, I've been struggling for some time with embedding a third party framework into a Flutter plugin I'm writing for iOS.

The plugin is fairly straightforward, mostly just forwarding calls and events to/from the third party framework.

The third party framework in questions is for controlling a Sphero robot (RobotKit.framework).
This particular framework is an umbrella framework, with several sub frameworks within.

To include this .framework in my plugin, I've tried a lot of combinations between

preserve_paths
vendored_frameworks
resource
xcconfig

in the .podspec file to link to the RobotKit.framework package (inspired by blog), but without luck.

I can use

vendored_frameworks = 'Frameworks/RobotKit.framework'

to get Xcode to detect the package and import the headers, but when building I get an error linking to a header in one of the sub frameworks (RobotKitClassic is a sub framework):

fatal error: 'RobotKitClassic/RobotKitClassic.h' file not found #import <RobotKitClassic/RobotKitClassic.h>

Am i approaching this the wrong way, or is there a trick that I'm missing?

2 Answers 2

2

I ended up working around this by implementing the plugin functionality directly in my main app project instead of in a separate Flutter plugin.

Doing this, i can add the RobotKit framework to the Runner project and it links, builds and runs just fine.

Sign up to request clarification or add additional context in comments.

Comments

1

IF your case is nested frameworks to use the result in app then nesting frameworks isn't allowed in IOS , here from apple forums , I faced error like can't load frameWork @rpath to do this all code in dynamic framework must be pure code not pods or plugins

enter image description here

3 Comments

To clarify a few things: I'm not building the .framework myself, only trying to use it in my Flutter plugin. Also when using the same third party (umbrella) framework in a regular iOS Xcode project (ObjC) it builds and runs without any issues.
using it or creating are same nested isn't allowed all must be pure code no sub-frameworks
umberalla works if content inside framework is pure Code , and to try it , try to create adynamic framework and use pods inside it and take the result framework in any sample app , the app won't see the pod frameworks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.