Xcode supports using the old version of the framework

From the very beginning of my project, I have been using a custom framework, I will call it "custom.framework". But there was a mistake in this structure, and now I want to use a different version of "custom.framework".

First, I just deleted the “custom.framework” file from my project and added a new one. But nothing has changed, the error is still there.

After several attempts and hours, I realized that Xcode adds the old version to memory and uses this instead of the new one. I know this because in the new version I added a method and when I cmd + clicked the class to which I add this method, it does not exist and the file path is not available.

Searching the Internet, I tried to change some version parameters for my framework projects: compatibility version, Curent Library version, Framework version. But that did not change anything for Xcode, which continues to use the old version.

I also tried to make the framework project as a subproject and add the resulting structure as a dependency on my goal. It worked well, but since the framework project is in a remote git repository, I don't think this is an acceptable solution.

So, my last attempt was to create "custom2.framework" to force Xcode to use the real file, not some cached version. But then again, this will not work, and when I create it, I get errors telling me that all my classes in custom2.framework are duplicated characters of its cached version of "custom.framework".

So my question is simple: how can I finally tell Xcode to remove its cached old version and let me use the file that I gave it? I already tried to delete my project outputData file, but it seems that there are no cached frameworks. I am so desperate :(

Edit: here are 2 screenshots to illustrate the problem.

The first screenshot is the path shown by Xcode when I opened the file from a .framework in the project navigator. From the project navigator

The second screenshot is the path shown by Xcode when I opened the file with cmd + click for "DCEquipmentManager" in the code. enter image description here

As you can see, the code-related framework is not the basis of the project.

+7
ios caching objective-c frameworks xcode
source share
4 answers

it seems that the problem is with the binding in the new structure, your project is still connected with the old frame files. try to delete all the files and folder associated with your "custom.framework", and also remove the path for this environment from the project settings → build settings → search path

Then after dragging and dropping your "custom.framework" files into the project.

he works for me. Hope it solves your problem.

0
source share

Please try to clear the derrived data: Window → Organizer on the right side you will see a list of projects. Find your project and click on it. At the top of the window you will see the delete button in front of the Derrived data, click on it.

I think this will solve your problem.

0
source share

This may sound silly, but sometimes restarting Xcode or the whole machine corrects the situation.

Have you deleted the old framework from Build Phases -> Link Binary Files to Libraries ?

0
source share

Use the Clean Build Folder: option-shift-command-K or select it from the Product menu by holding down the alt / option key.

0
source share

All Articles