Error while linking an app - iphone

getting this error while linking an app, some one an idea?
ld: duplicate symbol _OBJC_METACLASS_$_FBCustomLoginDialog1 in ....
Command
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang
failed with exit code 1
As i know i linking a file twice... budet how to fix it?

The same .m file is likely included in your project twice. See this thread for suggestions on how this could have happened.

Related

Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

I have some problem with my project. Can someone who's good in xcode help me up with that linker error on skype or teamviewer? I didn't made that code but it was working earlier but now it shows some linker error
Command
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
Thanks for any help in advance.
1 >I was using scrollview delegate methods in my project when i didn't set the UIScrollViewDelegate in my header file.
2 >The linker error was generated because I deleted the whole .xib file once but when I added a new .xib file and tried to link it that aroused this error.
To fix this error I had to make a new project and copied all my code in that new project.There may be an easier way to do this but this is what I did to fix it.
Ref Bridging-header.h causes Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1
Cleaning 'Other Librarian Flags' of all content works

Strange compiler warning when precompiling prefix.pch

When I want to start my app, I get this:
clang: error: invalid version number in '-mios-simulator-version-min= '
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
What's going on? When I google this error, I'm getting ZERO. This seems to be a very strange failure.
Please apologize, that I can't give more information. It's because I'm completely clueless.
Help!
OK, I've found the solution:
.xcodeproj > General > Deployment Target ----> was empty!
This is not allowed.
Try cleaning your project and/or quitting and relaunching Xcode. I've had various odd problems with Xcode that require one or the other of those things.
In my case there is a space after 8.0 like "8.0 ". When I remove space and re-build error disappears.

ld: 871 duplicate symbols for architecture armv7, clang: error: linker command failed with exit code 1 (use -v to see invocation)

I am using FastPDFKit in my iPhone app for displaying PDF. When I run the project on simulator, it works fine. However when I run the project on iPhone, it gives me below error.
duplicate symbol _value_map in:
/Users/alkandari/Desktop/iPhone Apps/MyTest002/MyTest002/FastPdfKit.embeddedframework/FastPdfKit.framework/FastPdfKit(FastPdfKit)
duplicate symbol _writeUnicodeToUTF8Buffer in:
/Users/alkandari/Desktop/iPhone Apps/MyTest002/MyTest002/FastPdfKit.embeddedframework/FastPdfKit.framework/FastPdfKit(FastPdfKit)
ld: 871 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: 871 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any idea why it is happening like this?
Error comes when I add FastPDFFramework in Configuration in Debug and Release section.
Here's a solution I found even after messing with the header/framework search paths, rebuilding, etc:
http://support.fastpdfkit.com/discussions/problems/443-i-am-unable-to-link-fastpdfkitembeddedframework
I removed the -all_load linker flag in my project and it compiled successfully. As a warning, make sure removing this flag is appropriate for your project. It was probably placed there for a reason
Can you try to clean up the FastPdfKit target and recompile it? It should generate a new framework ex-novo that you then should be able to add to you project, overwriting the one you are using. You can grab the new .embeddedframework in the FastPdfKit project root directory.
These line helped me from the link below.
http://support.fastpdfkit.com/discussions/problems/759-duplicate-symbols-for-architecture-armv7
there are another reason this error often happens is accidentally importing the .m file instead of the .h.
it's happened to me :)
link : https://stackoverflow.com/questions/12279622/duplicate-symbols-for-architecture-i386-clang
You have too many #include or #import directives in header files for the same things. Move to using #class in headers and only import/include in your .m files.
In all you just need to review where these are and reassess them.
I add my solution, as if you follow the readme, it will ask you to do:
Inherit the project options: select the Project an from info tab and configurations line choose **FastPdfKitFramework** from the drop down list;
I replace the FastPdfKitFramework target to None and now it work great.
As it is on the readme file, I never add .a in my project so download the recompile one don't help me as I do not want to restart all integration.
I hope it can be helpful for someone.
I tries removing -all_loads linker flag, and it worked for me without any problem in the project.

Stuck with "Command /usr/bin/codesign failed with exit code 1 " Error

I am getting the following error in all my the projects after I installed xcode 4.2 in parallel with xcode 3.2.5 I get the error when I create an adhoc bundle for the Tester.
How can I resolve this?
I have gone through following blogs but can't find any solution.
Command /usr/bin/codesign failed with exit code 1
http://www.iphonedevsdk.com/forum/iphone-sdk-development/9370-codesign-failed-exit-code-1-a.html
http://blog.emmerinc.be/index.php/2009/03/26/codesign-failed-with-exit-code-1/
/usr/bin/codesign failed with exit code 1
I have seen this error when I manually built and signed an iOS application bundle using a Makefile. In that case my Info.plist was missing the CFBundleResourceSpecification key (should probably have the value ResourceRules.plist). I did some more testing now and it also happens if the key CFBundleExecutable is missing.
CFBundleResourceSpecification should be added in some build phase by Xcode but maybe it's a good idea to check the resulting Info.plist in the build directory if it's really there.
Maybe this blog post could help, it's about codesign finding the wrong Info.plist file (one without CFBundleResourceSpecification)
http://infinite-sushi.com/2010/08/the-case-of-the-missing-cfbundleresourcespecification/

GCC-4.2 Failed With Error Code 1

I am receiving the following error out of the blue after trying to build my iPhone Application onto my iPod Touch:
Command /Xcode3/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
I am also receiving the following warnings which I presume have something to do with this error, maybe a possible cause:
ld: warning: in /Users/Max/git/iTopCharts/iTopCharts/Classes/NSAdditions/libNSAdditions_Device.a, missing required architecture i386 in file
ld: warning: in /Xcode3/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/usr/lib/libSystem.dylib, missing required architecture i386 in file
ld: in /Xcode3/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/usr/lib/libobjc.A.dylib, missing required architecture i386 in file
All help with this is extremely appreciated, as I have spent days making this application.
This error is caused by many different problems.
Sometimes it gets called, when some file has been deleted, but its reference is still in the Xcode.
OR
It might occurs, if you have copy-pasted data from some other project. In some cases, Xcode keeps the reference with it. (If this is the case, then you need to trace that variable, and rename it)
If none of above meets your case, then you need to look at the error in more details. For this,
In xcode, right click the error line and choose "Open These Latest Results as Transcript Text File". This will open the real xcode output log, which should contain a better description of the error then was previously seen.
EDIT:Be sure to search 'exit code 1' and the description will be right above the results.
I hope it helps