Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I embed XCFramework (third-party) in a Xcode project?

I found that the project would fail to build (error:image not loaded) if the normal third-party framework does't set as "embedded" in the project settings. However, this time, I rebuilt this third-party framework as XCFramework, and everything goes fine with "Do Not Embed" settings for XCFramework.

Should I embed XCFramework or not?

like image 524
Linc Avatar asked Oct 10 '19 10:10

Linc


People also ask

What does embed mean in Xcode?

Xcode Libraries section screenshot I guess "embed" means "copy into app bundle". I also guess the "sign" bit really means "re-sign" using your credentials. – trojanfoe. Aug 28, 2019 at 7:40.

What is an XCFramework?

What is XCFramework? Apple defines XCFrameworks as a distributable binary package created by Xcode that contains variants of a framework or library so that it can be used on multiple platforms (iOS, macOS, tvOS, and watchOS), including Simulator builds.

Where is linked frameworks and Libraries in Xcode?

If you're building for iOS, tvOS, or watchOS: On your application targets' “General” settings tab, in the “Linked Frameworks and Libraries” section, drag and drop each framework you want to use from the Carthage/Build folder on disk.


1 Answers

Select "Embed & Sign" to avoid image not found crash when running apps on physical device which contains any third-party XCFrameworks.

This option can be selected from linked xcframework under Targets -> General -> Frameworks, Libraries and Embedded Content.

enter image description here

But the application with xcframework will work fine in simulator with any of options available from Do Not Embed, Embed & Sign or Embed Without Signing.

like image 119
Alpana Avatar answered Sep 20 '22 22:09

Alpana