Error “library not found for -lPods-MyProjectTests-KIF” when installing KIF in existing workspace

时间秒杀一切 提交于 2019-12-25 08:52:47

问题


I run into this error when adding KIF to an existing Xcode 6 workspace:

ld: library not found for -lPods-MyProjectTests-KIF

What may be special about my situation that MyProject.xcworkspace/ resides in the parent directory of MyProject.xcproject/ (and depends on several other sibling projects as well):

./MyProject.xcworkspace/
./MyProject/
./MyProject/MyProject.xcworkspace/
./MyProject/Podfile

My Podfile is as follows:

target 'MyProjectTests', :exclusive => true do
  pod 'KIF', '~> 3.0', :configurations => ['Debug']
  workspace 'MyProject'
end

When I run pod --project-directory=./MyProject install and open MyProject.xcworkspace the target MyProject still compiles but I get the cited link error when building MyProjectTests.

How can I overcome that problem?

UPDATE My guess by now is that some settings are not inherited correctly from Pods-MyProjectTests.*.xcconfig perhaps due to previous edits that removed $(inherited)s at the project or target level in some places (although this should normally produce warnings).


回答1:


My initial guess (in the updated question) was wrong. pod ... install created a new MyProject.xcworkspace\ as sibling to Podfile, not modify the one in the current directory. I had assumed the second by mistake.

These steps worked:

  1. move MyProject.xcworkspace/ down from its original location
  2. run pod install in the new location
  3. move MyProject.xcworkspace/ back to its original location
  4. in Xcode, delete its reference to Pods.xcodeproj/ (because the relative locations in the file system have changed) and recreate new reference to it.

Since this is a bit cumbersome I have also posted a new question.



来源:https://stackoverflow.com/questions/28497959/error-library-not-found-for-lpods-myprojecttests-kif-when-installing-kif-in-e

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!