XCode can't find wrong .app file - ios

I changed the name of my app from X to Y. It was working before, but for some reason it no longer is working after doing a fresh pull. It's giving me this error (from YTests):
ld: file not found: <DerivedData Directory>/X.app/X
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It's looking for X.app instead of Y.app. I've looked through the build settings and it is Y.app everywhere. It's looking for the wrong file inside of Tests. When I disable testing, I can run the app but I still get the error. Any suggestions?
Note: I'm using Xcode6-Beta5.

After digging around, I realized that this was the actual cause of the error. What confused me is that it was working for a while, and then it stopped all of a sudden.
xcode 4 fails to initiate unit tests (with linker error) after I created a new scheme
The solution is:
Go to build settings of the test target.
Search for your old app name.
Replace old app name with new app name. (Linking -> Bundle Loader -> Debug & Release)

Related

Apple Mach-O Linker Error When Building Starter Code

I am using Xcode 8.2.1, Swift 3, and IOS 10.2 (for iphone simulator). I am trying to follow this tutorial https://www.raywenderlich.com/139322/firebase-tutorial-getting-started-2
I have not gotten to the Firebase stuff. Right now I am just trying to build and compile the starter code (should run fine). When I do this, however, I get the following error:
ld: library not found for -lPods-Grocr
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How do I fix this? PS. I have done a pod install successfully.
When I first began working with Firebase I encountered many issues like this and for a while wondered if scrapping the whole Application and restarting was the best option. In the end the fix was simply, getting rid of the modules inside my app and uninstalling the pods then going back through the process of installing them. Sometimes a file will be place in the wrong directory so when the app goes to build it is looking for something that cannot be found and it fails. Good luck let me know if you have any more questions or issues.

Xcode from Unity: "Linker command failed with exit code 1 (use -v to see invocation)"

I am getting a "Linker command failed with exit code 1 (use -v to see invocation)". As far as I understand, it is telling me that I am missing some framework.
1. I have added all the frameworks manually:
:
After cleaning and trying again, the error still persists but it complains about another framework!
2. I have also set the 'Search Path' in 'Build Settings' to recursive:
Every time I try and built it on my ipad I get the same error but complaining about a different framework despite 1&2. Has come across this?
I am working on Xcode Version 7.3.1
The error screenshot:
Directort Structure:
UPDATED Search Path:
I think that Can You check Project Target>Buil Phases>Link Binary with librarys in more than one time it is define or podfile is define multiple time some frameworks.
I was having the same issue w/ my project. I install my pods via CocoaPods, once I open up the workspace project created, I import the modules to the file. At first there will be an error, but once you Build the project, it will sweep the error. That's how I fixed my issue.
In the end, removing the all the problematic frameworks (those starting with QT) allowed me to build the app and didn't cause any noticeable issues. Its not a particularly satisfying solution, but it worked ...

Compiler error after adding a new Configuration in project

I encountered an issue after setting up a new value for Configuration when building (after reading the following post: Different App Icons for your iOS Beta, Dev, and Release builds). The error message is as follows:
ld: file not found:
/Users/.../Library/Developer/Xcode/DerivedData/SomeAppName-.../Build/Products/Debug-iphoneos/SomeAppName.app/SomeAppName
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
I'm not sure how to fix it, checked and double checked with the article and I did follow everything as explained.
Edit: The error appears to be from the Tests target
Managed to find the answer: https://stackoverflow.com/a/29887473/2124535
I solved it in Xcode 6 very easy like this:
Select your project in the project navigator.
Select the YourProjectTests under targets
Under General tab change the Host Application from the drop down
Build and run.
This problem happened to me because I renamed my project and the tests could't find it anymore. - Yowza7
Removing the Tests target did not help for me.
I posted a solution that did work here: Created new XCode Configuration and Scheme - linker is suddenly failing
It basically involves telling Xcode to look for the libraries created using the Release configuration.

Debug scheme won't build - Apple Mach-O Linker Error. Linker command failed with exit code 1

ld: library not found for -lPods-AFNetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I get this error way too often and it's driving me (and the team nuts). The project was building just fine last week and I did nothing to the project in the mean time, just opened it yesterday and now I'm getting this error when building using the Debug scheme only; Adhoc builds fine. I'm running the latest Yosemite, Xcode 6.1 (but this has plagued me for many months anyway). My instructions to resolve it work occasionally, like black magic:
Clean
Restart Xcode
Delete derived data (check preferences/locations)
Pod update
Open project using the Workspace file
Delete the workspace file and run pod install
But unfortunately this time it's just not working! I've done this process over and over. I'm so frustrated with this PoS Xcode. Next step would be to re-download the project from Git, but there must be a better way! I have gone through a number of other stack overflow posts but found nothing to help (nor anything very recent). Thanks!
The same error drove me nuts for two days. I fixed through the following :
Project > Targets > Build Settings > Packaging > Product Name - Check if the product name has changed.
Also try setting the Build Active Architecture to NO in your project..
Project/Pods > Build Settings > Architectures > Build Active Architecture Only
Just delete the build folder of your project and rebuild it again. Always works for me!

Xcode 4.6 causing libobold2d-ios.a not found error in Kobold2D

I'm getting the following error after upgrading Xcode to 4.6 and building my Kobold2D project:
ld: file not found: /Users/Jon/Library/Developer/Xcode/DerivedData/Kobold2D-
awxpgwvfoipnxpdyaptbdirnnfwq/Build/Intermediates/ArchiveIntermediates/Kodable-
iOS/BuildProductsPath/Release-iphoneos/libkobold2d-ios.a
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It happens only when building the IPA with product>archive. I can run directly on the device no problem. This leads me to believe its a distribution permissions setting.
I've done some research on the error here, and also reviewed similar questions on SO. I have an idea of what the problem is, but none of the solutions seem to fix the issue.
This only just happened with Xcode 4.6. I've been able to build IPAs before no problem, and even have the app in the App Store, so I don't know what changed to cause this.
I figured this out today, so I will answer it for anyone else that might have this problem.
Somehow the libkobold2d-ios.a file (along with a few others) were removed from the "link binary with libraries" section of build phases. I definitely didn't do that manually, so I don't know why they were missing, but when I added them back it worked.
A quick note - They will still show up as red, because they have to be built at compile time.

Resources