Last Updated: 26 Feb 2015
There are two types of errors. Compile time and Run time. If you’re not familiar with Objective C then correcting these errors will be very difficult for you. So in that case its always best to send the error logs to us. Next two sections discusses how to send the error logs to us for Compile time and Run time errors.
They prevent your application from being run and they can be inspected in Issue Navigator (command + 4). If you app shows a red mark with white exclamation mark inside it then its a compile time error. Fig 1.
Runtime errors occurs while app has built successfully and code is syntactically all right but due to unexpected conditions at runtime app crashes. e.g divide by zero error.
We don’t get any information on such errors via issue navigator but we get some info from console.A typical runtime error looks like Fig 4 which shows console output. Most of the time it shows error in main.m file which is inside Supporting Files group.
Most basic thing you can do is
All apps are created from latest Xcode so for smoother setup its recommended to have latest Xcode on your system too. Steps are:
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
Then your Xcode is updated
Many times our project build fails only due to some misconfiguration, missing components/files or old libraries. For this all iOS projects are built over Cocoapods, which is a dependancy manager and takes care of all of the above problems.
So Cocoapods is a dependancy manager (just like rubygems). It is based on Ruby and mac comes with Ruby and so you can just type
sudo gem install cocoapods
to install it. More information on http://cocoapods.org/.
If you already have a version of Cocoapods installed then try updating it by running same command.
Now opening .xcworkspace file combine two projects into one. The iOS App and its dependancies. In the project navigator you can see them as two large blue icons at root level of tree. The latter is always called Pods. Inside it you’ll find a file called Podfile and if you open it you’ll find name and version of all dependancies. A sample file looks like this.
target ‘FBDemoSDK’ do
pod ‘Facebook-iOS-SDK’, ‘~> 3.20’
target ‘FBDemoSDKTests’ do
It says that App FBDemoSDK app requires Facebook-iOS-SDK to be installed. ‘~> 3.20′ means that it will install versions 3.20 onwards upto 3.29.
pod ‘Facebook-iOS-SDK’, :head
above line will always install the latest bleeding edge version on the SDK which might be risky sometimes but beneficial also. (more info: http://guides.cocoapods.org/using/the-podfile.html)
So if you get errors related to some libraries used then this is you’re going to do first.
(Note: As of current version of Cocoapods you’ll need at least Ruby 2.1 for this to work correctly. Please check cocoapods.org for the correct version of Ruby to be used.)
this command will take some time to update dependancies or install missing dependancies. Be patient until it finishes.
Go here Xcode Schemes
ld: library not found for -lPods
– Generally this happens when Xcode is unable to locate your Pods.
– Most common case is when you open blue icon (.xcodeproj file) and not the white icon (.xcworkspace file). Remember .xcworkspace file combines your project with Pods and make it complete. Open your project by double clicking the white workspace file and not the blue file.
– Another cause can be misconfiguration. Discard the content of that folder and start afresh. Unzip your project folder and run pod install while Xcode is closed. Running pod commands while Xcode is open may also cause this error.
Tags: debug iOS app