Wierd error when trying to run app with AdMob - iphone

Undefined symbols for architecture i386:
"_AudioServicesPlaySystemSound", referenced from:
-[GADWebViewDelegate webView:shouldStartLoadWithRequest:navigationType:] in libGoogleAdMobAds.a(GADWebViewDelegate.o)
"_OBJC_CLASS_$_MFMailComposeViewController", referenced from:
objc-class-ref in libGoogleAdMobAds.a(GADOpener.o)
"_OBJC_CLASS_$_MFMessageComposeViewController", referenced from:
objc-class-ref in libGoogleAdMobAds.a(GADOpener.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
What does it means? what do I need to do in order to fix that?
Thanks alot.

FYI - I had to add the AudioToolbox framework to get this to compile.

The solution was to add AVAudioPlayer and MessageUI frameworks. That's about it.

From where ever you have got the library that you are using, its only compiled to be used on the device.. (architecture armv7), where as you are trying to test it on the simulator (architecture i386) thus the error. So if you want to test it on the simulator, get a version of the library which is compiled for i386.
You can also combine both the libraries using lipo command and use it on any architecture..
hoping this helps.. :)

Related

Upgrade from Facebook iOS SDK 3.2.1 to 3.5 gave me an error with FBCrypto

After installing the new sdk I cleaned the project and build it. It fails with this message:
Undefined symbols for architecture i386:
"_SecRandomCopyBytes", referenced from:
+[FBCrypto randomBytes:] in FacebookSDK(FBCrypto.o)
-[FBCrypto encrypt:additionalDataToSign:] in FacebookSDK(FBCrypto.o)
"_kSecRandomDefault", referenced from:
+[FBCrypto randomBytes:] in FacebookSDK(FBCrypto.o)
-[FBCrypto encrypt:additionalDataToSign:] in FacebookSDK(FBCrypto.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Same problem anyone? Solutions?
Well, you need to include the security framework and the libsqlite3.dylib as stated here.
It works now.
edit
Also found this now...
Jumping on this, im running into the same issue, I saw that the FBSDK needs the Security, AdSupport, etc. Here's my linked libraries:
My error is the same:
Undefined symbols for architecture i386:
"_SecRandomCopyBytes", referenced from:
+[FBCrypto randomBytes:] in FacebookSDK(FBCrypto.o)
-[FBCrypto encrypt:additionalDataToSign:] in FacebookSDK(FBCrypto.o)
"_kSecRandomDefault", referenced from:
+[FBCrypto randomBytes:] in FacebookSDK(FBCrypto.o)
-[FBCrypto encrypt:additionalDataToSign:] in FacebookSDK(FBCrypto.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
All the other framework dependencies are good to go as far as I can tell. A Vlean->Build didn't fix it either. Thanks.
Edit: Got it. I needed to re Add Files to Project and check the Add to Target button.. basically XCode automagicka

iPhone - How to add AdSupport.framework in ios?

I am trying to use the AdMob in my test application when I rum my application i am getting the following error as shown below.
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_ASIdentifierManager", referenced from:
objc-class-ref in libGoogleAdMobAds.a(GADIdentifierUtilities.o)
"_OBJC_CLASS_$_SKStoreProductViewController", referenced from:
objc-class-ref in libGoogleAdMobAds.a(GADOpener.o)
"_SKStoreProductParameterITunesItemIdentifier", referenced from:
-[GADOpener openInAppStore:fallbackURLString:] in libGoogleAdMobAds.a(GADOpener.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I googled around this errors and everyone telling to add the AdSupport.framework. But when I try to add that framework in my Xcode4.1 and Xcode4.4 there is no AdSupport.framework is not missing. Where can I get it and how to add that framework.
AdSupport.framework available only in iOS6+, so you won't be able to find it in XCode version prior to 4.5
UPD:
According to AdMob 6.2.0 changelog:
Required to use Xcode 4.5 and build against iOS 6. The minimum deployment is iOS 4.3.

Getting "_OBJC_CLASS_$_NgnEngine" error after linking iOS fat library

Why i am still getting this error even after linking fat library
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_NgnEngine", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
and linking everything in "User-Defined
I am following the instruction which written here Link ios-ngn-stak to your app
any help please, this is tiring me and it is my senior project
please refer this two link for getting solution if your issue:-
Error : "_OBJC_CLASS_$_NgnEngine"
Xcode with iOS - Creating a library in a way that is easy to run in debug mode, distribute, iterate

Undefined symbols for architecture i386: "_PerformXMLXPathQuery"

I looked at all the others that had a similar title but none of those solutions worked for some reason... Hoping someone can help!
Undefined symbols for architecture i386:
"_PerformXMLXPathQuery", referenced from:
-[WeatherForecast connectionDidFinishLoading:] in WeatherForecast.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
"_PerformXMLXPathQuery", referenced from:
-[WeatherForecast connectionDidFinishLoading:] in WeatherForecast.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am new to iOS so any help would be greatly appreciated!!
Seems like you are compiling for the simulator (i386) with a library for the Device (ARM). Either compile for the device and run on it or get an i386 version of the library and run with it on the simulator.
For those who need it, the issue was that my XPathQuery.m file was not in the Complied Sources list. It was as simple as that!
Just posting this for future reference! Hope it helps someone!

Simple Torch Application in XCode

I am trying to build a simple torch application for iOS 5 as described in http://developer.apple.com/library/mac/releasenotes/AudioVideo/RN-AVFoundation/_index.html#//apple_ref/doc/uid/TP40010717-CH1-DontLinkElementID_17 but i am getting "Apple Match-O Linker Error:
Undefined symbols for architecture armv7:
"_AVMediaTypeVideo", referenced from:
-[FirstViewController viewDidLoad] in FirstViewController.o
"_OBJC_CLASS_$_AVCaptureDevice", referenced from:
objc-class-ref in FirstViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any help appreciated
Anybody ?
Additionally: it only happens when running the project, no errors if i just clean & Build, and the code completion detects the library.
Thanks
You might need to link your project with the AVFoundation framework first.
If you're already doing that, make sure you're building for armv7 and not just armv6.
Check it in your project settings > Target > Build Settings > Architecture
As simple as this:
Linker errors like this indicate that a symbol is missing when the app is being linked. Most system symbols like these, come from system frameworks. So, I was missing a framework in my project that contains AVCaptureDevice and AVMediaTypeVideo.
To solve it, i just added the AVFoundation framework following this tutorial: http://www.thinketg.com/Company/Blogs/11-03-20/Xcode_4_Tips_Adding_frameworks_to_your_project.aspx
Now it runs !