Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The frameworks' link path has changed after the project moved to another place

please take a look at the picture: enter image description here

It's my project structure:

  1. 1 app(top one)
  2. 3 frameworks (create by myself)
  3. 1 cocoa pods static library(bottom one)

When I cmd+b, all the sub projects would be build start from the bottom one to the top one, here is no problem, everything are fine.

  • To refer/link the frameworks, I drop the framework product to every sub project's /Build Phases/Link Binary With Libraries and /Build Phases/Copy Files.

The problem is:

  • When I copy/move the project folder to another place (like ~/oldFolder/app to ~/newFolder/app) the sub project cannot finds the frameworks, it report Not Found Error, I need re-build and drop the framework product to link to fix the error.

It's too stupid and hard to work with other people, anyone can help?

p.s.: sorry for my poor english.

Add error pic: enter image description here

like image 219
Raniys Avatar asked Jul 30 '16 05:07

Raniys


2 Answers

You can use $(SRCROOT) if you want to refer paths relative to your source directory . $(SRCROOT) will point where your project files are . apple doc

An example :

if you have a directory x in your MyApp folder which contains your project file then the folder x can be reffered as $(SRCROOT)/x. Enter this in frameworks path section in Build settings to refer to your library .

like image 132
MedAmine.Rihane Avatar answered Nov 03 '22 18:11

MedAmine.Rihane


This all boils down to you not being able to change the location of the already imported frameworks right? This is an example with the FBSDKCoreKit.framework. If I were to change the folder location I would need to change the relative path. Click on the folder Icon right next to the name and choose the new location

enter image description here

like image 36
tech4242 Avatar answered Nov 03 '22 17:11

tech4242