Xcode get error when using Coapod - ios

I'm using Cocoapod to get Global Lib. It works fine in the simulator, but it has some error when I build on my device:
Undefined symbols for architecture armv7s:
"_OBJC_CLASS_$_FBRequest", referenced from:
objc-class-ref in HomeViewController.o
"_OBJC_CLASS_$_SBJsonParser", referenced from:
objc-class-ref in IQRequest.o
"_AFNetworkingOperationFailingURLResponseErrorKey", referenced from:
___78-[IQRequest performQueueOperationWithRequest:withSuccessBlock:andFailedBlock:]_block_invoke39 in IQRequest.o
"_OBJC_CLASS_$_AFHTTPRequestOperation", referenced from:
objc-class-ref in IQRequest.o
"_OBJC_CLASS_$_AFHTTPClient", referenced from:
objc-class-ref in IQRequest.o
"_OBJC_CLASS_$_FBSession", referenced from:
objc-class-ref in ChooseDesignerViewController.o
objc-class-ref in IQUser.o
objc-class-ref in IQAppDelegate.o
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
What has happened to my project?

It seems like your library isn't compiled for armv7s. If it's distributed as binary you'll have to ask the maintainer to rebuild it with an armv7s slice. If it's distributed as source code you have to check the projects build settings. I think you should look for valid architectures or something like that.

Related

iOS Build Error Using Quickblox Pod file in AWS Mobile SDK

We have an iOS application that is referencing the AWS Mobile frameworks directly and several other libraries using CocoaPods. The project builds fine
But, when we add the 'Quickblox-SDK' as an additional library to reference in the PodFile and run pod install I get several build/linker errors:
Undefined symbols for architecture x86_64:
"_AWSSNSErrorDomain", referenced from:
___88-[AWSPushManager interceptApplication:didRegisterForRemoteNotificationsWithDeviceToken:]_block_invoke.239 in AWSMobileHubHelper(AWSPushManager.o)
"_OBJC_CLASS_$_AWSSNS", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSPushManager.o)
"_OBJC_CLASS_$_AWSSNSCreatePlatformEndpointInput", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSPushManager.o)
"_OBJC_CLASS_$_AWSSNSGetEndpointAttributesInput", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSPushManager.o)
"_OBJC_CLASS_$_AWSSNSSetEndpointAttributesInput", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSPushManager.o)
"_OBJC_CLASS_$_AWSSNSSubscribeInput", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSPushManager.o)
"_OBJC_CLASS_$_AWSSNSUnsubscribeInput", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSPushManager.o)
"_OBJC_CLASS_$_FBSDKAccessToken", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSFacebookSignInProvider.o)
"_OBJC_CLASS_$_FBSDKApplicationDelegate", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSFacebookSignInProvider.o)
"_OBJC_CLASS_$_FBSDKGraphRequest", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSFacebookSignInProvider.o)
"_OBJC_CLASS_$_FBSDKLoginManager", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSFacebookSignInProvider.o)
"_OBJC_CLASS_$_GIDSignIn", referenced from:
objc-class-ref in AWSMobileHubHelper(AWSGoogleSignInProvider.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
If we remove the $(inherited) flag from the Other Linker Flags build setting, getting below errors:-
bash: /User/..../AWSCore.framework/strip-frameworks.sh: No such file or directory
uploadDSYM[13005:219405] Fabric.framework/run 1.4.1 (160)
uploadDSYM[13005:219405] Launched uploader in validation mode
bash: /Users/..../Frameworks/Quickblox.framework/strip-framework.sh: No such file or directory
Any Help will be appreciated..
Thanks,
in your Pods-{PROJECT_NAME}.debug.xcconfig and Pods-{PROJECT_NAME}.release.xcconfig file, find this line
OTHER_LDFLAGS = $(inherited) -ObjC -l"z" ....
and remove the -ObjC
Alternatively, you can also fix this from XCode by going to Build Settings -> Other Linker Flags, and remove -ObjC from there

GoogleMaps for iOS Linker Error

While building the Application i am getting the following error i have searched a lot but i am unable to figure out what is the problem.
ld: warning: ignoring file /Users/username/GoogleMaps/GoogleMaps.framework/GoogleMaps, missing required architecture arm64 in file /Users/username/GoogleMaps/GoogleMaps.framework/GoogleMaps (2 slices)
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_GMSPolyline", referenced from:
objc-class-ref in GPSController.o
"_OBJC_CLASS_$_GMSCameraPosition", referenced from:
objc-class-ref in GPSController.o
"_OBJC_CLASS_$_GMSMutablePath", referenced from:
objc-class-ref in GPSController.o
"_OBJC_CLASS_$_GMSMarker", referenced from:
objc-class-ref in GPSController.o
"_OBJC_CLASS_$_GMSMapView", referenced from:
objc-class-ref in GPSController.o
"_OBJC_CLASS_$_GMSServices", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am using GoolgeMaps SDK 1.4.3
PS:- I am relatively new to iOS programming so please avoid any blunders.
Adding value $(inherited) to BuildSettings->Linking->Other Linker Flags of your target
If you are developing an SDK/framework/POD you should do the same as above but under target name PROJECTNAME_tests.
Should fix the issue.
I had this problem too, and my solution was to add the frameworks to
Target -> Build Phases -> Link Binary With Libraries
ok I figured out the Problem
My Library was not built for 64-bit but i was trying to use that settings for my app, after i removed arm64 from architecture i successfully build the application.

Problems building Twitter's Fabric API in Xcode

I'm trying to install Fabric and have followed the instructions (add Run Script Build Phase, Build, Drag files into project (copy off)) and all looks good.
However as soon as I try to run the app, I get a flood of errors:
ld: warning: directory not found for option '-F/Users/michael/Developer/Digicub/Mini2/MGBF2/APIs/ParseChat/Framework'
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_NSManagedObjectContext", referenced from:
objc-class-ref in TwitterKit(TFSScribe.o)
"_OBJC_CLASS_$_NSPersistentStoreCoordinator", referenced from:
objc-class-ref in TwitterKit(TFSScribe.o)
"_OBJC_CLASS_$_NSManagedObject", referenced from:
_OBJC_CLASS_$_TFSScribeEvent in TwitterKit(TFSScribeEvent.o)
_OBJC_CLASS_$_TFSScribeImpression in TwitterKit(TFSScribeImpression.o)
"_OBJC_CLASS_$_NSManagedObjectModel", referenced from:
objc-class-ref in TwitterKit(TFSScribe.o)
"_OBJC_CLASS_$_NSFetchRequest", referenced from:
objc-class-ref in TwitterKit(TFSScribe.o)
"_NSSQLitePragmasOption", referenced from:
-[TFSScribe _setupManagedObjectContext] in TwitterKit(TFSScribe.o)
"_NSInMemoryStoreType", referenced from:
-[TFSScribe _setupManagedObjectContext] in TwitterKit(TFSScribe.o)
"_OBJC_CLASS_$_NSEntityDescription", referenced from:
objc-class-ref in TwitterKit(TFSScribe.o)
"_OBJC_METACLASS_$_NSManagedObject", referenced from:
_OBJC_METACLASS_$_TFSScribeEvent in TwitterKit(TFSScribeEvent.o)
_OBJC_METACLASS_$_TFSScribeImpression in TwitterKit(TFSScribeImpression.o)
"_NSSQLiteStoreType", referenced from:
-[TFSScribe _setupManagedObjectContext] in TwitterKit(TFSScribe.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've retried a few times, uninstalling, reinstalling. Thought it might be clashing with Twitter.framework, but removing this doesn't have any effect. Any ideas how to resolve?
According to the comments by #rmaddy
Add CoreData framework worked.
Your bundle should look like this:

Apple Mach-O linker errors While Archiving My project

I am trying to archive my First iOS Project and I get the following errors. It seems like there is something bugged with the Facebook SDK and Google Plus SDK which i have used for Authentication. I have come across similar questions on stackoverflow but none's solutions helped me. Any help would be appreciated. Thanks in advance.
<pre>
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_FBRequest", referenced from:
objc-class-ref in LoginViewController.o
"_OBJC_CLASS_$_GTMLogger", referenced from:
objc-class-ref in LoginViewController.o
"_OBJC_CLASS_$_GTLQueryPlus", referenced from:
objc-class-ref in LoginViewController.o
"_kGTLAuthScopePlusLogin", referenced from:
-[LoginViewController getInfoForGoogle] in LoginViewController.o
"_OBJC_CLASS_$_GTLServicePlus", referenced from:
objc-class-ref in LoginViewController.o
"_OBJC_CLASS_$_GPPURLHandler", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_GPPSignIn", referenced from:
objc-class-ref in LoginViewController.o
"_OBJC_CLASS_$_FBSession", referenced from:
objc-class-ref in AppDelegate.o
objc-class-ref in LoginViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
</pre>
The framework you are using is not arm64 ready, ie not for 64bit devices, you can either check if an updated framework is available, or exclude arm64 that from your build
Set the architecture in build settings to Standard architectures(armv7,armv7s)
Xcode 5 and iOS 7: Architecture and Valid architectures

Need help in iOS lib armv7 and 64 bit version

I'm creating a project with Core-Plot lib.
I add the lib with static way.
How can I run my app in 32 + 64 bit devices?
if I run lipo libCorePlot-CocoaTouch.a -info
console response:
Architectures in the fat file: libCorePlot-CocoaTouch.a are: armv7 armv7s arm64
But this library works only with 32bit devices/simulator with 64bit simulator give me this error:
ld: warning: ignoring file PATH/libCorePlot-CocoaTouch.a, missing required architecture i386 in file PATH/libCorePlot-CocoaTouch.a (3 slices)
Undefined symbols for architecture i386:
"_CPTDecimalFromCGFloat", referenced from:
-[HomeViewController configureSecondPlots] in HomeViewController.o
-[HomeViewController configureSecondAxes] in HomeViewController.o
"_CPTDecimalFromInteger", referenced from:
-[HomeViewController configureSecondAxes] in HomeViewController.o
"_OBJC_CLASS_$_CPTAxisLabel", referenced from:
objc-class-ref in HomeViewController.o
"_OBJC_CLASS_$_CPTColor", referenced from:
objc-class-ref in HomeViewController.o
"_OBJC_CLASS_$_CPTFill", referenced from:
objc-class-ref in HomeViewController.o
"_OBJC_CLASS_$_CPTGraphHostingView", referenced from:
objc-class-ref in HomeViewController.o
"_OBJC_CLASS_$_CPTMutableLineStyle", referenced from:
objc-class-ref in HomeViewController.o
"_OBJC_CLASS_$_CPTMutableTextStyle", referenced from:
objc-class-ref in HomeViewController.o
"_OBJC_CLASS_$_CPTPieChart", referenced from:
objc-class-ref in HomeViewController.o
"_OBJC_CLASS_$_CPTPlotSymbol", referenced from:
objc-class-ref in HomeViewController.o
"_OBJC_CLASS_$_CPTScatterPlot", referenced from:
objc-class-ref in HomeViewController.o
"_OBJC_CLASS_$_CPTTextLayer", referenced from:
objc-class-ref in HomeViewController.o
"_OBJC_CLASS_$_CPTXYGraph", referenced from:
objc-class-ref in HomeViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How can I fix this problem?
Thank you
Combine both libraries and make a universal binary
lipo -create <simulator_lib>.a <device_lib>.a -output lib.a
Open the Core Plot iOS project (CorePlot-CocoaTouch.xcodeproj), update the architecture build settings to include 64-bit, and build the "Universal Library" target. This will create a folder called "Release-universal" in your build folder containing a universal library with all architectures (device and simulator) and copies of all of the header files.

Resources