Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cocoapods command line build fails

I have just added cocoapods to my project, but cannot get my build script working again. I use this command to make the build:

xcodebuild -workspace MyProject.xcworkspace -scheme MyScheme SYMROOT=./build

However, when I perform the build, it fails with the error message ld: library not found for -lPods.

If I build without the SYMROOT set, it works fine. But I would prefer keeping the SYMROOT argument such that I can keep my archiving logic the same way as before.

My conclusion so far is, that because SYMROOT is set, xcodebuild cannot find the Pods library that was built. How can I fix this?

Edit:

I have investigated the file structure after the build a little:

  1. If I do not set SYMROOT, there is a libPods.a file in the folder with the binaries (Library/Developer/Xcode/DerivedData/MyProject-eegsyonkmltdqhggwyqytoqbwath/Build/Products/).
  2. If I set the SYMROOT as described above, the libPods.a file is not present in ./build

Hence, it seems that the output of the build of the pod files are not set properly. Is it a problem in xcodebuild then, or is there a way that I can ensure that the pod files are built to this folder?

The following image shows a comparison of the build output in the two directories to make it more clear: Comparison of build output

like image 382
JRV Avatar asked Feb 06 '14 12:02

JRV


1 Answers

Instead of using xcodebuild -workspace MyProject.xcworkspace -scheme MyScheme SYMROOT=./build

Try with this line:

xcodebuild -workspace MyProject.xcworkspace -scheme MyScheme SYMROOT=$(PWD)/build

Hope this will help you.

Explanations here.

like image 178
dkrdennis Avatar answered Sep 27 '22 18:09

dkrdennis