Xcode product archive error - ios

When I try to archive my project with Xcode I've got an error:
ld: library not found for -lReachability
clang: error: linker command failed with exit code 1
Can you help me how to fix that?

You need to set the path that Xcode use to find your Reachability framework.
Create your search path like this
$(PROJECT_DIR)/../yourFramework/lib
and add it in Build Settings-> Framework Search Paths for both debug and release builds.
You can get the exact path from Finder get info.
Check the reference links
Link
Link

Related

Apple Mach-O Linker Error when Facebook installed using pods in the project

I have just installed the Facebook using pods and now my project is not working and says. Please help someone.
Apple Mach-O Linker Error
ld: 87 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
duplicate symbols for architecture means your files are doubled, Please check if you have added facebook framework manually before using pods
you can also check files duplicating by seeing whole description of error
Solution 1
You need to do this:
Click on your project (targets) Click on Build Settings Under Library Search Paths, delete the paths May be this will help you.
Solution 2
You have duplicate symbol method which means there are duplicate file in project
In your Target's Build Phase, under "Compile Sources" check if there are duplicate file and delete one if you have duplication.
Hope this will help you.

Library not found -lAdIdAccess ios

Today when i have started compiling the code i am getting the folloing error
I have tried the other option like, setting the liker flag, framework search path,
ld: library not found for -lAdIdAccess
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I was able to solve the same problem with the following code.
Add this to the Library Search Paths in Build Settings and make sure you select recursive, delete other library paths which might be absolute paths.
$(PROJECT_DIR)
May be it will help you.
-lAdIdAccess is a part of Google Analytics SDK.
Don't forget to add a path to the SDK in Build Settings -> Framework Search Paths. Select "recursive" if the SDK is in a subfolder.

Library not fount -lPods

I got follwing errro in my application.
ld: warning: directory not found for option '-L/Users/idev/Desktop/Swami/Project/Sources/Xcode/chronicle/chronicle/Vendor/openssl-1.0.1e/lib'
ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Please help me...
You need to open ".xcworkspace" instead of ".xcodeproj". the .xcworkspace is generated when you install pod on the project.
Xcode is not able to find the library, and hence the library error. Click on the project target, go to build settings, under search paths -> frameworks search paths, delete paths. You may have moved your desktop folder along with the library.
It seems project has been using http://cocoapods.org/. and that files are missing from your project.
You cant just download it from git. You need to install it from cocoapods.
you may follow Introduction to http://www.raywenderlich.com/64546/introduction-to-cocoapods-2 Tutorial

Xcode mach -o linker

When i am trying to compile my project with NMSSH framework, XCode 5 says:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_NMSSHSession", referenced from: objc-class-ref in HelloWorldViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
What should I do?
I ran into a similar issue myself. Here's what I did to fix it.
Open the downloaded Git repo in Finder
Open the NMSSH-iOS.xcodeproj file. NOT the NMSSH.xcodeproj!
Clean and build the project.
Follow the steps from the Github wiki page https://github.com/Lejdborg/NMSSH/wiki/Build-and-use-in-your-iOS-project
Actually, this itself is on the wiki page too. I know I opened the wrong Xcode Project and it seems like a lot of people do it accidentally. So, that's what I had to do to resolve it. Also, you'll have to build the framework for either the physical device or the emulator, depending upon what you're using and add to your project depending.
Hope this helps! Good luck!
You need to link NMSSH.framework with your project.
Open Build Phases in your project settings and add NMSSH.framework into the group Link Binary With Libraries.
Try this:
Click on the project then go to build settings and type linker flags in the search bar
Add "-ObjC" to "Other Linker Flags"

Cannot Archive when a library is included in my own iOS custom framework

I created my own iOS framework by following this tutorial, https://code.google.com/p/ios-static-framework/, which uses a static library template and aggregate target with a custom run script to create a framework.
At first it works fine. After including another library in the framework project creates the error when archive or build for device. I think the problem is with some wrong settings for that library. But I just don't know what to try. I have tried setting some sensible Other Linker Flags from https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/ld.1.html , but no luck. Can anyone help please ;(
What steps will reproduce the problem?
Follow the tutorial, but change the Aggregate script architecture from armv6 armv7 to armv7 armv7s. Here is the part of the aggregate target script I changed. Everything else is the same.
if [[ "$SF_SDK_PLATFORM" = "iphoneos" ]]
then
SF_OTHER_PLATFORM=iphonesimulator
SF_ARCHS=i386
else
SF_OTHER_PLATFORM=iphoneos
SF_ARCHS="armv7 armv7s"
fi
Add an external library to the project, here I use libBlocksKit.a.
Build the framework, success.
In another child project. Include my built framework.
Add -ObjC in the app Target > Build Settings > Other Linker Flags
Archive and get error. Building for device (iPhone5) gives error too. But building for simulator seems to work.
What is the error?
This error, basically "ld: warning: directory not found for option ... ld: lto: could not merge in ... symbol multiply defined!".
ld: warning: directory not found for option '-L/Users/hlung/Dropbox/- Notes/stackoverflow/RealFrameworkApp/RealFrameworkApp/External/BlocksKit'
ld: lto: could not merge in /Users/hlung/Library/Developer/Xcode/DerivedData/RealFrameworkTest-evagqzwzyyolhjenkkjbvzibxppf/Build/Products/Debug-iphonesimulator/RealFrameworkTest.framework/RealFrameworkTest(NSObject+BlockObservation.o) because 'Linking globals named 'OBJC_CLASS_$_BKObserver': symbol multiply defined!', using libLTO version 'LLVM version 3.2svn, from Apple Clang 4.2 (build 425.0.28)' for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
If I archive my child project with only one architecture (like armv7), it works. It shows this error with armv7 armv7s architectures ( $(ARCHS_STANDARD_32_BIT) ).
What version of the product are you using? On what operating system?
OS X 10.8.5, XCode 4.6.3
== Update 1 ==
Posted an issue at the tutorial's code.google.com page Update: 2 weeks no answer.
I found a set of useful suggestions from this answer. Update: Doesn't work
I have created a project so you can run and see for yourself here
Linking against a static library from within a framework can create some interesting challenges... It sounds like you may be linking to BlocksKit from both your framework and your application projects.
You should link in only one of those places. Try removing libBlocksKit.a from the Link Libraries build phase of your framework, but leave it in the other project.
You can do like this:
Click on your project (targets)
Click on Build Settings
Under Library Search Paths, delete the paths
I hope it can help you.

Resources