Adding frameworks to project in Xcode 5 and having

2020-01-30 06:23发布

问题:

All of a sudden today I get an unexpected problem with Xcode (5).

This is how I normally add an external framework:

Drag-n-drop the file (xxx.framework etc) (or the folder which contains the file) into the project manager. In "Choose options for adding files" I check "Copy items into destination (if needed)" only if needed (if the files are already in the project's folder I don't do this) In "Folders" I select Create groups for any added folders And I add it to my app target.

Normally this would also add the relative path(s) to the framework in Build Settings/Framework Search Paths and Library Search Paths.

However today the path that shows up there is direct (aka absolute). This breaks stuff down the line because the paths should be relative. How come Xcode does this all of a sudden? I suspect it might have to do with this one project only (it comes from a 3rd part dev) and something about their project setup could be causing this.

回答1:

I faced the same issue. There is a simple fix. Go to framework search paths. Remove everything from there. Add ./ and make it recursive. That's it.



回答2:

I am having the same problem on XCode 5, so far the best solution is to modify the path of your framework search.

Go to your project

Build settings->Framework search path

Add the relative path to your framework.

If it was correctly copied now you can modify the path, to something like this:

./MyProject/Libraries/ACoolLibrary

Supposing a file structure like this:

-MyProject.xcodeproj

-MyProject

--Libraries

-----ACoolLibrary

-------- TheCoolLibrary.framework



标签: ios xcode