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

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.

Related

how to solve the error of linker command failed with exit code 1 (use -v to see invocation)

I got one error when I run my app. The error is linker command failed with exit code 1 (use -v to see invocation).
The error shows me that there are 2 duplicate symbols for architecture x86_64.
I could not find a solution. How can I fix this?
Please help me for this issue.
It looks to me as if you have both 2.0 and 3.0 AFNetworking in your project. I don't see AFURLConnectionOperation in the 3.0 source but your link log shows it in conflict with AFURLRequestSerialization, which is in 3.0.
In fact, the github migration guide says:
The following classes have been removed from AFNetworking 3.0:
AFURLConnectionOperation
AFHTTPRequestOperation
AFHTTPRequestOperationManager

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

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 = "";

Not found an file de MOIP on Objective C

I just develop MOIP with ready-made components, but received the error after running.
Showed an error message:
"ld: file not found: /Users/teste/Library/Developer/Xcode/DerivedData/Moip_Store-fakuiehavrpkaeggjvvtbovybkyh/Build/Products/Debug-iphoneos/Moip Store.app/Moip Store
clang: error: linker command failed with exit code 1 (use -v to see invocation)"
site: https://github.com/moip/ios-sdk-sample
Someone solve this problem?
how?
Select your Project and choose your "Moip Store Test" - Target, go to "General" and set your Application as Host Application.

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

Duplicate symbol error when linking AdMob SDK in RubyMotion

My RubyMotion project builds fine, but fails at the linking stage, specifically when linking against GoogleAdMobAds, with a "duplicate symbol" error:
Compile ./app/controllers/blahblah_view_controller.rb
# compiling here, everything is awesome, until...
Create ./build/iPhoneOS-6.1-Development/App.app
Link ./build/iPhoneOS-6.1-Development/App.app/APP
duplicate symbol _GAD_MD5 in:
/Users/edd/Projects/ProjectName/vendor/GoogleAdMobAdsSDK/libGoogleAdMobAds.a(md5.o)
/Users/edd/Projects/ProjectName/vendor/GoogleAdMobAdsSDK/libGoogleAdMobAds.a(gad_md5.o)
ld: 1 duplicate symbol for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
rake aborted!
Command failed with status (1): [/Applications/Xcode.app/Contents/Developer...]
/Library/RubyMotion/lib/motion/project/builder.rb:393:in `build'
/Library/RubyMotion/lib/motion/project/app.rb:72:in `build'
/Library/RubyMotion/lib/motion/project.rb:56:in `block (2 levels) in <top (required)>'
Tasks: TOP => build:device
(See full trace by running task with --trace)
It's worth noting this occurs only when building for device. It works fine running in the simulator. Relevant Rakefile line:
app.vendor_project('vendor/GoogleAdMobAdsSDK', :static)
This problem also occurs when including the SDK via CocoaPods.
Any suggestions?
After perusing support forums for Google's AdMob, I found this thread basically saying issues have been observed when linking against the AdMob SDK when passing the -force_load flag to ld. Nobody goes into any more detail than that, but whatever.
Browsing the source, I also found an undocumented config option for RubyMotion's vendor_project that can make its invocation of ld use simply -ObjC instead of -force_load for your vendored code, and apparently that's what was needed to make this compile for me:
app.vendor_project('vendor/GoogleAdMobAdsSDK', :static, force_load: false)
Voila. I unfortunately can't explain why this is only happening when building for a device (probably something to do with -force_load combining with arch flags somewhere deep in RubyMotion), so if anyone can offer any wisdom, please leave a comment here.
If you really need to use -force_load (too much conflicts on the project with -ObjC for example) you can do the following.
Get a hexa editor (0xED for example)
Open the static lib with it
Go to the last line
Change the name of the constant to something else
save
done!

Resources