当把CocoaPods生成的workspace移动到上层目录时,需要改下Pods.xcconfig和工程里的一些设置,就通常没什么难度。

当遇到这个问题时:


[plain]view plaincopy

print?

CouldnotautomaticallyselectanXcodeproject.SpecifyoneinyourPodfilelikeso:

xcodeproj'path/to/Project.xcodeproj'


在Podfile文件里指定下工程目录就行了,比如我在Podfile文件添加这行就行了:


[plain]view plaincopy

print?

......

xcodeproj'Portfolio/Portfolio.xcodeproj'

......

主要是让Pod找到子目录中的工程文件。


当在update或install时遇到这个问题:


[plain]view plaincopy

print?

Unabletofindaspecificationfor`xxxxx(~>1.x.x)`dependeduponbyPodfile.

只需要把当前Pod的目录清理一下就行了。在终端执行以下命令:



[plain]view plaincopy

print?

podreporemovemaster

podsetup

setup成功后执行install或update即可。