Undefined symbols for architecture armv6 - iphone

My app compiles fine on the iPhone simulator running iOS 5.0, but it fails on my older physical iPod touch running iOS 4.2.1.
I'm getting the following error:
Undefined symbols for architecture armv6:
"_OBJC_CLASS_$_TestFlight", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture armv6
I've looked at other questions about this:
Undefined symbols for architecture armv6, Updating to iOS 4.3
But they're solutions do not work. Indeed, TestFlight.h was not in Compile sources, but dragging it to Compile Sources did not change the error message. (There is no TestFlight.m; I have libTestFlight.a in "Link Binary with Libraries"
Similarly, deleting and retyping #import "TestFlight.h" in AppDelegate.m did not change anything.
What else could be causing this compile error on my iPod?

First, a .h file is not a source file, so remove it from "Compile Sources" again.
About the error - you are probably using a version of the TestFlight SDK that does not support armv6 - they re-enabled this architecture in a recent version. Update to the newest version of the SDK and see if that helps.

Click on your project, select
Target
and then goto
Build Phases
In
Compile Sources
added AppDelegate.m, it might not be connected, compiler is unable to find the file.
Also see link

Related

"_OBJC_CLASS_$_GDataOAuthAuthentication", referenced from:

i am new in ios developement.i have a project while run on ios 5.1 simulater it is working fine and not getting any error but in that same project while run on ios 6.0, ios 6.1 simulator i am getting following errors.Can anyone suggest me how can i rectify this problem?
Errors:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_GDataOAuthAuthentication", referenced from:
objc-class-ref in GDataOAuthViewControllerTouch.o
"_OBJC_CLASS_$_GDataOAuthSignIn", referenced from:
objc-class-ref in GDataOAuthViewControllerTouch.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Try this,
The main problem was,I thought you are using old GData sdk. You just
change the compiler to LLVM GCC 4.2 from Apple LLVM 4.2 and it
compiles app perfectly.
i have attached screenshot for your reference
Project->Target->Build Settings->Build options
You're linking against external libraries that haven't been compiled for your current architecture/SDK version. I see you're using VDOAds library, which was probably precompiled against the 5.1 SDK. You'll need to get a version that was precompiled for the latest iOS SDK.
TargetSettings -> Build Phases -> Compile Sources and make sure that these missing libraries are included there.
So you have two problems, for the warnings, the libraries were added to your Build Phases but they were deleted from the project and they are still there.
For the error, the library that you are using is not added to Build Phases -> Link Binary With Libraries.
So in order to fix this warnings/errors, go to your project Targets -> Build Phases -> Link Binary With Libraries, and search for libGoogleAnalytics (I think this is the one for GA) and remove it (if not needed).
Also add the VDOAds library there in order to fix the error.
I also add a screenshot with the targets, it will be easier to find it if you don't know about it.

error:""_OBJC_METACLASS_$_CDVViewController", referenced from:" in Xcode4.3

I am new to iphone develop and phonegap also. Now i want to create simple iphone app using phonegap. Now i am using phonegap2.0 in lion mac. MY Xcode version is 4.3. Now my issue is after install the phonegap2.0 in xcode when i run the Xcode in my Simulator 5.0. I got this below error.
"Undefined symbols for architecture i386:
"_OBJC_CLASS_$_CDVViewController", referenced from:
_OBJC_CLASS_$_ViewController in ViewController.o
objc-class-ref in AppDelegate.o
"_OBJC_METACLASS_$_CDVViewController", referenced from:
_OBJC_METACLASS_$_ViewController 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)"
Please help me to solve this issue. Thanks in Advance.
And i have attach the Screen Shot of error page for your reference.
Check if your project links libCordova.a (in my case Xcode forgot about the reference, when moving CordovaLib.xcodeproj to another location).
select your project in the Project Navigator
go to the Summary tab
drag CordovaLib.xcodeproj > Products > libCordova.a to Linked Frameworks and Libraries
Clean & build.
Please check your ViewController.m file and goto to
1. Build phase in xcode
2. Select Compile Sources
3. Press + button to add .m/.mm file
I think it will run successfully now
Remove armv7s from your build settings, for both your project and the referenced subproject Cordova. Set your target to 4.3.
I had a similar issue. Somehow my the NSManagedObject Sub-classes of my Core Data entities were in the Compile Sources table twice. The compiler would choke when it hit the first of these duplicates.
I just went into the Compile Sources table and deleted the second occurrence of each .m listing.

Google plus SDK emits linker errors when trying to integrate with iPhone App

Some simple things sometimes just don't work ;) like this one! Am trying to integrate Google+ SDK into an iPhone App by following the instructions given here:
https://developers.google.com/+/mobile/ios/#initialize_the_google_client
I did every single step. But when I build the App, it complains of the following errors:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_GTMOAuth2Keychain", referenced from:
objc-class-ref in libGooglePlusUniversal.a(GooglePlusSignIn.o)
"_OBJC_CLASS_$_GTMOAuth2SignIn", referenced from:
objc-class-ref in libGooglePlusUniversal.a(GooglePlusSignIn.o)
"_OBJC_CLASS_$_GTMOAuth2ViewControllerTouch", referenced from:
objc-class-ref in libGooglePlusUniversal.a(GooglePlusSignIn.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The classes it's reporting of, are part of the Open Source Google Toolbox project (which is also present in the downloaded SDK, but the instructions ask the user to include only GooglePlusShare.h and libGooglePlusUniversal.a in the project in XCode). I tried including the header files from the directory 'google-plus-ios-sdk-1.0.0\OpenSource', but that's of no use. I tried including the entire (not just .h files) from the directory 'google-plus-ios-sdk-1.0.0\OpenSource' & it leads to lot of ARC related errors (more than 500 of them!); so I quit this option.
Any help on how to resolve these linker errors please?
My environment: XCode 4.3.3, iOS 5.0, Mac OS X Lion 10.7.4, testing with iPhone 4
Just select GData.xcodeproj .
select GDataTouchStaticLib from target .
search "othet c flag"
remove "-DGTM_INCLUDE_OAUTH2=1" if exist
add "-DGDATA_INCLUDE_OAUTH2=1"
click on done. clean project and then build.
Missing keychain and auth-stuff usually means you never imported the Security.framework in your project.
Check another time if you really did include the libraries
Security.framework
SystemConfiguration.framework
in your Xcode project as described in step 1 of the instructions you referred to.
To verify this:
Click on your project name in xcode and select your target.
Under the tab "Build Phases" these two frameworks should be listed under the secition called "Link Binary With Libraries".
If not listed, press the + button to add them.

Why does this debug build reference a release library?

I just installed Xcode 4 and am getting this error in my project:
ld: warning: directory not found for option '-LDebug-iphonesimulator4.3'
ld: warning: ignoring file /Developer/Projects/BuildOutput/Release-iphoneos/libMyFramework.a, missing required architecture i386 in file
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_MyRandomNumber", referenced from:
objc-class-ref in myAppDelegate.o
objc-class-ref in RootViewController.o
I have the project set to iOS 4.3 Simulator. I did check that scheme and it is set to debug build configuration. Why does it reference a Release version of the above library?
Also, what is the i386 error about?
I'm seeing this type of error as well. The odd part is that I've been building, linking, and running successfully under the Simulator. I just now tried to fire my app up in my iPhone, and am totally bombing out during the link process.
I've run my app on my iPhone before. I've been building it under Xcode 3.2.x for the last year, and have never seen this problem.
A couple of other SO threads indicate that it could be due to copying a framework into the project folder, and that one should just "move the framework." Okay. Where, and how do I let Xcode know where it is? And if that's not the problem, then what is?
Xcode 4 has a ton of promise, but it is a sore pain in the ass sometimes....

iPhone JSON Error After Upgrading to Xcode 4 and iOS 4.3

I just updated to Xcode 4 and iOS 4.3 but now when I try to build/run my project, it returns the following JSON SDK error:
ld: warning: ignoring file /var/folders/OV/OVQ5LuaPFY4lW0L0a9jdRk+++TI/-Caches-/com.apple.Xcode.501/CompositeSDKs/iphoneos-iPhoneOS4.3-dqtvoenrseczxwakgamuhnlmhcbu/usr/local/lib/libjson.a, file was built for archive which is not the architecture being linked (armv7)
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_SBJSON", referenced from:
objc-class-ref in Neighbourhoods.o
objc-class-ref in StreetLevel.o
...
ld: symbol(s) not found for architecture armv7
collect2: ld returned 1 exit status
After upgrading to Xcode 4, it now seems to be trying to build for release whereas in the old versions I believe it was building for debug, but I can't seem to see where I can change that.
I've got the JSON SDK installed under ~/Library/SDKs/
The SDK has been added to the Additional SDKs section for both release and debug. I've also made sure that the following 'Other Linker Flags' are also added to both release and debug: "-all_load -ObjC -ljson".
After checking/adding all that, it still won't build.
Anyone able to shed any light on this problem?
I'm not sure why in the end it stopped working after the update, but I have now removed the SDK and just added the source code to the project, not ideal but it works.
I had the same error when building a third-party library, when under 4.2.6 it didn't complain before. Open up the library project, go to the menu "Project --> Edit Project Settings --> Build Tab" and look under "Architecture".
Under the sub-items "Architectures" and "Valid Architectures" check that they contain a reference to "armv7". If not you will have to select/add it.
Do the same for your active target: menu "Project --> Edit Active Target --> Build".
After making the changes, build again, and you should not have linker errors.
I had working project that failed to link after I switch to SDK 4.3 after updating Xcode 4. I removed ARM7 from the target architecture, leaving only ARM6, and that fixed it. A shot in the dark but perhaps others can use this workaround too.