Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode showing error with embedded framework but it compiles well

Tags:

xcode

ios

swift

I have an app with a custom Swift framework that is used to share business rules across different plateform. Every time I try to use a class from this framework, Xcode is showing me errors but everything compiles well. It also preventing me from using autocompletion regarding this framework.

I already try cleaning and deleting derived data but without any results.

My framework is included in my main projet via a submodule and manually linked on my main project.

Any thoughts on this ?

enter image description here

like image 293
Yaman Avatar asked Oct 21 '25 13:10

Yaman


2 Answers

I think your problem is with the framework's search path. I assume its now set for the target but not for the project (or incorrectly set on the project). You can set it only for the project and let Xcode handle target path.

Xcode has a separate compilation process for computing autocomplete references, from the compilation process for actually building your project. If you accidentally set the framework search path for your target instead of the project as a whole, your project will seem to build fine. https://medium.com/@_achou/one-weird-trick-to-fix-autocomplete-in-xcode-9f19dc856944

Solution 1: Fix framework search path in Project - Build Settings.

Solution 2: Remove the framework from your project, head to Targets - Build Phase - Embeded Frameworks, click on + (add) and then Add Other and find it in your directory.

like image 162
Lukas Avatar answered Oct 23 '25 04:10

Lukas


Try removing your framework then CMD+B close XCODE open it again add the framework again and CMD+B. By the way have you moved your project folder recently??

Try this

like image 36
AD Progress Avatar answered Oct 23 '25 03:10

AD Progress



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!