react-native-builder-bob icon indicating copy to clipboard operation
react-native-builder-bob copied to clipboard

Adding xcframework as dependency to native modules

Open Kahan opened this issue 3 years ago • 2 comments

I've been trying to add a native xcframework library as a dependency to my iOS native modules. The iOS root application is missing the general tab in Xcode which is where one would as the framework dependency. I was able to successfully link an .aar library to my android native modules. Am I missing something while implementing in iOS or is it not supported?

Kahan avatar Jul 26 '22 17:07 Kahan

I have the same question. I also managed to include a .aar on the Android side, but i can't figure it out on iOS...

nicklasbring avatar Aug 09 '22 06:08 nicklasbring

That to the friends, to add the xcframework in the .podspec file that is in the root of the project you must add the line.

s.vendored_frameworks = 'ios/exmaple.xcframework'

you must keep the xcframework inside the "ios" folder that is in the root.

pulnec avatar Aug 16 '22 11:08 pulnec

Thank you Pulnec. I did get it to work when adding the dependency as a pod in the root podspec though. First time a tried to add it as a pod in the podspec, it also installed to pod, but it seemed like the link between the my own module and the pod wasn't fully there. The second time i tried it, it worked just fine.

nicklasbring avatar Aug 23 '22 05:08 nicklasbring

@nicklasbring, Excellent, can you leave an example here, of how you did it?

pulnec avatar Aug 23 '22 12:08 pulnec