Xcode Static Libraries Created in the Wrong Folder

I set up cocoapods for my project and I have been developing for quite some time without any problems. I recently added a new configuration for it called Beta, duplicating the Release configuration. At the same time, I added a scheme that will build goals using this configuration.

This new scheme will build everything without problems, but the connection will not work with the message (quite famous):

ld: library not found for -lPods

I know that the problems causing this error message have been widely discussed on the Internet with various causes and conditions:

None of these fixes seem to apply here. What I see when browsing the workspace folder is that Cocoapods build products are placed in Build/Products/Release-iphonesimulator instead of Build/Products/Beta-iphonesimulator , even if the application itself is built correctly in the latter. Moving all *.a files to Build/Products/Beta-iphonesimulator makes the simulator work, but the next assembly is still placed in the wrong location.

Edit

After some further research, the environment variable $BUILT_PRODUCTS_DIR correctly configured at the build stage for the application itself, but not when creating cocoapods products.

What causes this and how can I fix it?

Excluded problems

  • pod install starts several times
  • I work in the workspace, not in the project
  • Cocoapods configuration file in the new configuration is correctly installed

enter image description here

  • The location of the locations in the settings seems fine.

enter image description here

+7
xcode cocoapods
source share
1 answer

For recording, the problem is resolved. So, as I said, I use cocoapods, but my current setup is that one swap file and workspace are used for 3 projects that share libraries. As described in this problem , cocoapods will consider only one project from all those indicated in the podfile, and it turns one project (out of three) that it used did not have a beta configuration, so it did not feel the need to prepare for it. Therefore, when it came time to build a project with beta configuration, cocoapods were created for the release configuration and placed in some folder specific to release , so the beta project could not find it.

The fix was to create a beta configuration for all projects present in the workspace, forcing cocoapods to be created accordingly. Then Xcode will be able to connect everything correctly.

+1
source share

All Articles