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

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.

Related

Xcode Build Failure on Archive, but not on Run with ResearchKit

I'm trying to build a project that has ResearchKit in it, and whenever I build and run on a physical device (or the simulator, for that matter) it works fine. But when I attempt to Archive it, I get the following error:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_ORKVisualConsentStep", referenced from:
objc-class-ref in InformedConsent.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I followed the installation guidelines on the ResearchKit GitHub, and made sure to check that researchKit.framework was under the Frameworks, Libraries and Embedded Content section as well as the "Link Binary With Libraries" section of the build phases tab (as was described in this link as well as a couple others: Xcode build failure "Undefined symbols for architecture x86_64") but still nothing.
Is there something I'm doing wrong, or another setting I might be able to change?
UPDATE:
I noticed that the element that was throwing the error - ORKVisualConsentStep - was deprecated a few iOS versions ago. So by taking that out, I was able to get the project to archive.
I didn't want to put this as the accepted answer, though, because I wanted to see if there was a better solution than just deleting code.
Thanks for your help!

"_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.

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.

Facebook symbols not found for i386 architecture

I get the following error when trying to compile my project in xcode 4 (worked fine in xcode 3.x)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_FBSession", referenced from:
objc-class-ref in View1Controls.o
"_OBJC_CLASS_$_FBLoginDialog", referenced from:
objc-class-ref in View1Controls.o
"_OBJC_CLASS_$_FBRequest", referenced from:
objc-class-ref in View1Controls.o
"_OBJC_CLASS_$_FBStreamDialog", referenced from:
objc-class-ref in View1Controls.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
Can anyone explain whats wrong? I'm sure I've correctly imported the header files..
Thanks,
Jack
Assuming the libraries with these functions are included in the Xcode project, this error occurs when the libraries are not linked with the binary executable file. This can happen when upgrading an older project to a newer version of Xcode.
To fix it navigate to the project overview in Xcode. Click on the target. Click on Build Phases. Expand the "Link Binary With Libraries" list. If libraries are not listed, click the "+", and add the appropriate libraries.
You are missing a library/framework which caused the linker errors that you see. I'm not sure which framework is associated with Facebook functionality, it might be the general network related one. Let me see if I can find out which you need.
EDIT: Do you have the Foundation framework included with your project? Does the Facebook site maybe mention which one you need?
I don't work with facebook, but here's my thoughts:
That's a linker error, not a compiler one (which it would be if the header weren't imported). Have you imported the correct framework? And ensured XCode is telling the compiler to link to the correct library?
Its related to linker error. So just remove facebook framework from project and drag new one.
Remove existing facebook framework
Drag FacebookSDK.framework folder from the SDK installation folder into the Frameworks section of your project

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.