'warning: directory not found for option' error on build - ios

All of a sudden my app has started giving me an error when I try to build it. This is the error I'm getting:
ld: warning: directory not found for option '-L/Users/user/Documents/Developer/Alton-Towers-Times/build/Debug-iphoneos'
ld: file too small (length=0) file '/Users/user/Library/Developer/Xcode/DerivedData/Mouse_Times_Florida-eqhrhnbxmmkxtahdghmnvehbzbgt/Build/Intermediates/Mouse Times Florida.build/Debug-iphonesimulator/Mouse Times Florida WatchKit Extension.build/Objects-normal/x86_64/SecondInterfaceController.o' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Only thing I've really done since I last managed to get it to run was changing the bundle IDs and I also changed the app name. I've tried a few things including deleting the derived data, but nothing seems to have helped.
Anyone have any ideas?

I solved this warning removing the following setting: "$(SDKROOT)/Developer/Library/Frameworks"
This options is located in Settings -> Build Settings -> Search Paths -> Framework Search Paths
Setting location
My project continues compiling and working fine, after removing this option.

Veladan answer helped me to sort out that issue on an iOS8 project freshly migrated to iOS9.
This worked fine on the main target of my project, but the warning lasted on the unit tests target, so in the end I edited directly the project.pbxproj file and modified the entries :
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
);
to :
FRAMEWORK_SEARCH_PATHS = "";

Related

IPA Processing Failed: Could not resolve #executable_path

I am stuck with this error when exporting IPA.
I did refer similar questions and none of them worked for me.
I am migrating my project from carthage to SPM, most of the frameworks which I use support SPM and only two had XCFrameworks.
Have added XCFrameworks with Embed & Sign, and earlier I used to have the simulator architectures removal script, with XCFrameworks I have removed that from my build phase step now.
When looked in the standard log I could not spot any error when searched with "fail"
Is there anything in the standard log which would indicate an error which I should be looking for ?
EDIT: Before you close as Duplicate of How to fix "IPA processing failed" error in xcode 11?
Please check this is for Xcode 12 with SPM & XCFrameworks !
The only errors I can spot in the logs are below:
2021-02-10 09:37:47 +0000 Scanning IPA...
2021-02-10 09:37:50 +0000 warning: Failed to resolve rpath for **SDK: Could not resolve #executable_path for #executable_path/Frameworks from **SDK
2021-02-10 09:37:50 +0000 warning: Failed to resolve rpath for ***: Could not resolve #executable_path for #executable_path/Frameworks from ***
But when I compared with the logs from another project with similar set up, I can see the same set of "warnings" and I am able to generate IPA on the another project.

GCM linker command failed with exit code 1: Apple-Mach-O Linker Error

What I have done after 2 days of reading stack overflow:
Keywords to problem:
"Apple-Mach-O Linker Error",
"libGGLCore.a(Clientanalytics.pb.o,Icore.pb.o,Jspb.pb.o,LogsAnnotations.pb.o
...)", "_OBJC_CLASS_$_GSDK_PBExtensionRegistry"
,"_OBJC_CLASS_$_GSDK_PBGeneratedEnumDescriptor" ....
I Don't use pod. Manually Download files from Github
So I am stuck. How do I solve the problem(s) displayed in the image below:
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Did you download all the dependent pods? To make GCM work, you need Google, GoogleCloudMessaging, GGLInstanceID, GoogleInterchangeUtilities, GoogleIPhoneUtilities, GoogleNetworkingUtilities, GoogleSymbolUtilities, and GoogleUtilities.
There could be various errors in your code as per your description. Some of the possibilities are:
1. Please read this
2. Importing QuartzCore in the project might fix the issue too.
3. Cleaning the project and restarting might help you too.
4. Changing the architecture of the project from armv6 to armv7 or arm64 could help too.
5. Moving the linked library of GCM to another folder also causes this issue. Please check it out too.

Xcode 7.2 - clang: error: no such file or directory:

I keep trying to run my Xcode project titled 'Simple Calculator' and it keeps giving me the following error,
clang: error: no such file or directory:
'/Users/computerscienceyr1/Desktop/Simple Calculator/Simple
Calculator/ViewController.m'
Here is a screenshot of the whole issue Screenshot.
Each time I create a 'Simple Calculator' Directory, the error extends into: '/Users/computerscienceyr1/Desktop/Simple Calculator/Simple Calculator/Simple Calculator/ViewController.m' and goes on and on.
**UPDATED**
This is what happens when double clicked Screenshot.
Targets> Build Phases> Compile Sources - File exists.
Removed ViewController.m and others again. No changes occurred.
Try this: open the .pbxproj file, search for the file name and delete the rows where it appears, then add the file again to your project.
This post may help you as well.

Library not found for -llib. (clang: error: linker command failed with exit code 1 (use -v to see invocation))

I am working on a project that was previously done and uploaded on app store.When I run this app in Xcode 5.0 it is working fine but when I run this on Xcode Version 5.1.1 (5B1008) I am getting Linker error on both device and simulator.
Error Message- Library not found for -llib. (clang: error: linker command failed with exit code 1 (use -v to see invocation)).
I have searched a lot but I didn't get any thread about Library not found for -llib error. Is there anything I have to change in build settings to resolve this?
Look at the linker command line in detail for the -L options being used:
Then use Terminal or Finder to see if your libXXX.a file exists in those directories. If the library exists elsewhere then you need to configure your Library Search Paths:
However there several details which you have not provided in your question when using a library within an app:
Is the library built as part of the Xcode project/workspace (as in the first image)?
Is the library supplied by a third-party with binary (.a) and header files (as in the second image)?
TL;DR: I ran make in the wrong directory so the paths were messed up.
Problem:
>make
linking ../build/release/yubikey-personalization-gui
/usr/x86_64-suse-linux/bin/ld: cannot find -llib
...
I ran into this when compiling the Yubikey Personalisation Tool. I tracked down the -llib call in my Makefile which looked like this:
...
LINK = #echo linking $# && g++
...
LIBS = $(SUBLIBS) -L/usr/lib64 -L../lib/release -llib -lyubikey -lykpers-1 -lQtGui -L/usr/lib64 -L/usr/X11R6/lib -lQtCore -lpthread
...
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
So it was setting a variable called LINK which would print "linking" and then call g++, which is the compiler.
Then it set the var LIBS which would hold the ominous -llib.
Then it composes and runs the command $(LINK) ... $(LIBS).
Which runs g++ with the parameter -llib.
And what does that do? Turns out -l<something> is telling the compiler to use the something-library. So it asks for the library called lib here. Which is strangely generic. I figured out that the sources came with a directory called lib/, which was at ../lib.
So starting make from a directory higher up fixed it.
You should remove libstdc++ from other linker flags in your xcode project
https://stackoverflow.com/a/53103383/1344237

c lang error in xcode 5.0 after adding "fno-objc-arc" for some classes

I am working on Xcode 5.0,i copied JSON library files in to my project which are built with non arc, so i added complier flag "fno-objc-arc"for those JSON library compiler sources.
After doing this i am getting apple LLVM 5.o error.
clang: error: no such file or directory: 'fno-objc-arc'
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
Pleas help me to resolve this error.
If that's a command line option, and it is, you need to prefix it with a hyphen, such as with:
clang -fno-objc-arc ...
If you just use fno-objc-arc, it's going to think it's a file name you want compiled, and complain bitterly that no such file exists, as indeed it seems to be doing with the no such file or directory: 'fno-objc-arc' error.
Please note that there is no new line character after -fno-objc-arc. You can be assured by entering -fno-objc-arc and click somewhere around instead of hitting enter/return key.
This got my problem fixed!

Resources