Using the new iOS 7 Beta and downloading the latest version of AFNetworking, I went to File>Add Files to Project, and passed in the directory AFNetworking.framework. Now I'm getting a slew of linker errors. For a sanity check, I rolled back the commit history to iOS 6 and everything compiled successfully. Here's the log:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_AFHTTPClient", referenced from:
_OBJC_CLASS_$_CloudGlyphAPIClient in CloudGlyphAPIClient.o
"_OBJC_CLASS_$_AFJSONRequestOperation", referenced from:
objc-class-ref in CloudGlyphAPIClient.o
"_OBJC_METACLASS_$_AFHTTPClient", referenced from:
_OBJC_METACLASS_$_CloudGlyphAPIClient in CloudGlyphAPIClient.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Do I need to wait for AFNetworking to get up-to-date with the next version of iOS or is this an architecture issue?
Thanks
AFNetworking compiles and loads fine for me on iOS 7. The easiest solution would be for you to set up CocoaPods, and include AFNetworking that way.
See this answer for instructions on making sure the file is included in your target. This answer will explain all the pieces of the error message to you.
iOS 7 is probably a red herring, but if AFNetworking was working before (you didn't say), you may want to file a bug report if your libraries got unlinked when you upgraded.
Related
I'm currently trying to integrate the Google Consent SDK, but as soon as I call
[PACConsentInformation.sharedInstance requestConsentInfoUpdateForPublisherIdentifiers:#[ #"pub-0123456789012345"]
I get the following error in Xcode console:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_PACConsentInformation", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've been searching Stackoverflow for a couple of hours now and I've tried various things such as Enabling Bitcode, Updating Linker Flags with $(inherited), as well as a few other things like adding suggested frameworks and libz found in popular questions/answers here, but still no luck.
I've gone as far to try my project in Xcode 8.3.2, Xcode 9.0 and Xcode 9.2, all of which show this error.
Is there anything I'm missing?
I'm completely stuck for ideas now.
Thanks for you help.
Go to Build Phase -> Link Binary With Libraries then add PersonalizedAdConsent framework
I am trying to use the objective-git library for an ios application I am in the proccess of developing. I am able to get the library to compile, link, and run perfectly fine in the simulator. However, when I try to run the application on an actual iPad, I get the followign error:
Undefined symbols for architecture armv7s:
"_libiconv", referenced from:
_git_path_iconv in libObjectiveGit-iOS.a(path.c.o)
"_libiconv_close", referenced from:
_git_path_iconv_clear in libObjectiveGit-iOS.a(path.c.o)
"_libiconv_open", referenced from:
_git_path_iconv_init_precompose in libObjectiveGit-iOS.a(path.c.o)
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I believe the issue is that I am compiling the libgit2 library with a different version of iconv then the one included with ios. However, I have messed with the build script in an attempt to force it to link with the ios version, but the error persists. How should I go about properly linking the iconv library so that I can run the application on an actual device?
You need to add libiconv.tbd to 'Link Binary With Libraries' section in Build Phases.
Note: I know ObjectiveGit fixed this issue but maybe that helps to others those who are trying to use iconv in their projects.
I have a project which uses libcurl.all.a. It builds, links and runs perfectly on Xcode 4.6.3. But in Xcode5, it throws linker errors on undefined symbols. The error log is as follows.
Undefined symbols for architecture i386:
"_SSLCopyPeerCertificates", referenced from:
_darwinssl_connect_common in libcurl.all.a(libcurl_la-curl_darwinssl.o)
"_SSLDisposeContext", referenced from:
_Curl_darwinssl_close in libcurl.all.a(libcurl_la-curl_darwinssl.o)
_Curl_darwinssl_shutdown in libcurl.all.a(libcurl_la-curl_darwinssl.o)
_darwinssl_connect_common in libcurl.all.a(libcurl_la-curl_darwinssl.o)
"_SSLNewContext", referenced from:
_darwinssl_connect_common in libcurl.all.a(libcurl_la-curl_darwinssl.o)
"_SSLSetEnableCertVerify", referenced from:
_darwinssl_connect_common in libcurl.all.a(libcurl_la-curl_darwinssl.o)
"_SSLSetProtocolVersionEnabled", referenced from:
_darwinssl_connect_common in libcurl.all.a(libcurl_la-curl_darwinssl.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
SecurityFramework is already there in the project, and i have set Build Active Architecture Only to No. And since it compiles in Xcode 4.6.3, I don't think it got anything to do with missing target membership.
Is there any way to resolve this? Or a possible workaround, Its very essential to have this library working with Xcode5, since it needs to be used in an iOS7 application.
So, am posting the answer so that it could be useful for anyone who might face a similar situation. I was able to sort out the issue from the comments of #deltheli and #sergio, so many thanks to them for helping out.
So, I had to run
lipo -info
to know the supported architectures, and
found that armv7s and arm64 was not supported, so i tried compiling it in armv7, which failed and explains the problem why it works perfectly in Xcode 4.6 and not in 5. My libcurl was outdated! And the version I used didn't support some of the DarwinSSL symbols. Using a recent enough version fixed the issue for me.
I am new to Xcode.
I am adding some features on the old(iOS 3.2) xcode game project. This code never touched for more than a year until I touched.
It worked fine until I tried to make an .iap file. it ran ok and all my changes didn't make any error.
So I changed target device from iPhone 6.0 Simulator -> iOS Device, and tried archive. Unfortunately it generated bunch of errors:
ld: warning: ignoring file lib/libegn_neutron_http_Release_iphoneos.a, file was built for archive which is not the architecture being linked (armv7): lib/libegn_neutron_http_Release_iphoneos.a
Undefined symbols for architecture armv7:
"_EGN_setPollingInMenu", referenced from:
ExitGamesCreateSession(sLibraryData*) in exitgames.o
"_EGN_Neutron_New", referenced from:
ExitGamesInit(sLibraryData*) in exitgames.o
"_EGN_setServerUrl", referenced from:
ExitGamesCreateSession(sLibraryData*) in exitgames.o
......similar 34 errors continued
"_EGN_NeutronCls_Release", referenced from:
ExitGamesShutDown(sLibraryData*) in exitgames.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This project uses some "exitgames" library which supports social features.
Also this project have some wrapping part of "Brew" c++ codes.
I don't know which part has the problem. tried to figure out and searched a whole day but still couldn't get a clue.
Can anybody give me an advice?
Thank you.
Try running lipo -info exitgames.a from the command line, it should tell you what architectures the framework is made to support.
I want to add RevMob add in my app but there are some errors
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_SKStoreProductViewController", referenced from:
objc-class-ref in RevMobAds(RevMobStoreController.o)
"_SKStoreProductParameterITunesItemIdentifier", referenced from:
-[RevMobStoreController openStoreWithITunesItemId:] in RevMobAds(RevMobStoreController.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have added StoreKit,SystemConfiguration and RevMob Frameworks already.
I am using Xcode4.3 and ios4.2
Plz help me.
Thanks in advance.
You need to add the StoreKit framework
EDIT: I see now what you mean, there was an issue with the older versions, I'm adding a link to an edited framework to solve that issue: Edited Revmob Framework
You must link against StoreKit.framework
It looks like the ad sdk you have now does not include support for use with the simulator.
-[RevMobStoreController openStoreWithITunesItemId:] in RevMobAds(RevMobStoreController.o)
ld: symbol(s) not found for architecture i386
if you get anything that mentions "not found for architecture" means revmob didnt include classes for running on simulator. You have 2 choices. look for a missing library ".a file" or only compile for testing on a device.
I've ran into an issue with the new ios6 where revmob did not support the new iphone 5 armv7s architecture.
Double check your revmob installation or try compiling to your phone instead of the simulator
When your are dropping the files manually in xcode the files are not copied to Bundle. So "SKStoreProductViewController.m" was the file not copied in the bundle so the error occurred. To resolve the error. Drag the files only .m files to Copy Bundle Resourceas shown in the image
This error can also happen if you removed a file from your project and subsequently re-created it. Sometimes Xcode doesn't automatically re-include it in the 'compile sources' box (when you click on target).
Check the box and see if all of your source files are included, if not then drag them in and rebuild.
They release a new SDK version (4.6.0) that works perfectly on older Xcode versions!
This also happens with Appirater. I was getting this message:
Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_SKStoreProductViewController", referenced from: objc-class-ref in Appirater.o "_SKStoreProductParameterITunesItemIdentifier", referenced from: +[Appirater rateApp] in Appirater.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
---To Fix---
add StoreKit.framwork in --> BuildPhases
---Under-> Link Libraries with Libraries
If you have more than one target you might need to add the
StoreKit.framwork to both Targets.
I faced similar issue and after long search and checking sample RevMob code, i found this solution, may be help others:
Under project target, select Build Settings, under Deployment, check iOS Deployment Target, change the value to 'iOS 9.0' or higher.
I hope this help.