Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using xcframework within a framework

Can I use a .xcframework inside a .framework?

When I try this the framework target builds fine, but when I use this framework in an iOS app target, it gives build error

For eg:

MyApp is iOS app target
MyFramework is a framework (embedded in MyApp)
MyXcFramework is a xcframework (embedded in MyFramework)

A sample swift file inside MyFramework contains

import Foundation
import MyXcFramework

and builds successfully

But when MyFramework is added to MyAapp i get the following error

import Foundation
import MyXcFramework <- No such module MyXcFramework

Can anyone help what I am doing wrong?

like image 424
Rahul Chhetri Avatar asked Sep 10 '26 11:09

Rahul Chhetri


1 Answers

It seems like you are trying to use the xcframework without adding it to the app. If you want to use your xcframework in your app too you have to add that xcframework in your app target, you can avoid embedding xcframework in the framework and only embed for the app itself.

like image 94
Soumya Mahunt Avatar answered Sep 12 '26 03:09

Soumya Mahunt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!