Can't build GCM with Protobuf in Xcode - objective-c

Recently I've decided to integrate GCM to my project that already uses Google Protocol Buffers. Everything worked fine, sample was OK. But when I've tried to integrate GCM via CocoaPods to my project - I started receiving build errors:
Undefined symbols for architecture x86_64:
"_GSDK_PBLogicalRightShift32", referenced from:
_SerializedSize in libGcmLib.a(GCMSecureSocket.o)
"_OBJC_CLASS_$_GSDK_PBCodedOutputStream", referenced from:
objc-class-ref in libGcmLib.a(GCMSecureSocket.o)
"_OBJC_CLASS_$_GSDK_PBDescriptor", referenced from:
objc-class-ref in libGcmLib.a(GtalkCore.pb.o)
objc-class-ref in libGcmLib.a(GtalkExtensions.pb.o)
"_OBJC_CLASS_$_GSDK_PBGeneratedMessage", referenced from:
_OBJC_CLASS_$_GtalkHeartbeatPing in libGcmLib.a(GtalkCore.pb.o)
_OBJC_CLASS_$_GtalkHeartbeatAck in libGcmLib.a(GtalkCore.pb.o)
_OBJC_CLASS_$_GtalkErrorInfo in libGcmLib.a(GtalkCore.pb.o)
_OBJC_CLASS_$_GtalkSetting in libGcmLib.a(GtalkCore.pb.o)
_OBJC_CLASS_$_GtalkLoginRequest in libGcmLib.a(GtalkCore.pb.o)
_OBJC_CLASS_$_GtalkLoginResponse in libGcmLib.a(GtalkCore.pb.o)
_OBJC_CLASS_$_GtalkClose in libGcmLib.a(GtalkCore.pb.o)
...
"_OBJC_CLASS_$_GSDK_PBRootObject", referenced from:
_OBJC_CLASS_$_GtalkGtalkCoreRoot in libGcmLib.a(GtalkCore.pb.o)
_OBJC_CLASS_$_GtalkGtalkExtensionsRoot in libGcmLib.a(GtalkExtensions.pb.o)
"_OBJC_METACLASS_$_GSDK_PBGeneratedMessage", referenced from:
_OBJC_METACLASS_$_GtalkHeartbeatPing in libGcmLib.a(GtalkCore.pb.o)
_OBJC_METACLASS_$_GtalkHeartbeatAck in libGcmLib.a(GtalkCore.pb.o)
_OBJC_METACLASS_$_GtalkErrorInfo in libGcmLib.a(GtalkCore.pb.o)
_OBJC_METACLASS_$_GtalkSetting in libGcmLib.a(GtalkCore.pb.o)
_OBJC_METACLASS_$_GtalkLoginRequest in libGcmLib.a(GtalkCore.pb.o)
_OBJC_METACLASS_$_GtalkLoginResponse in libGcmLib.a(GtalkCore.pb.o)
_OBJC_METACLASS_$_GtalkClose in libGcmLib.a(GtalkCore.pb.o)
...
"_OBJC_METACLASS_$_GSDK_PBRootObject", referenced from:
_OBJC_METACLASS_$_GtalkGtalkCoreRoot in libGcmLib.a(GtalkCore.pb.o)
_OBJC_METACLASS_$_GtalkGtalkExtensionsRoot in libGcmLib.a(GtalkExtensions.pb.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 assumed that this is because GCM library has ProtocolBuffers in it and it is conflicting with my Protobuf sources that I've got from here:
https://github.com/google/protobuf/tree/master/objectivec
I've also tried to build for the device and as a result receive similar error - with armv7 instead of x86_64. Also I must say, that sample project works fine, so I think that Protobuf is that main issue here.
Still, I have no idea how this could be resolved. Any thoughts?

Check if the architecture of libGcmLib.a and your target build architecture are the same.
You can check the architecture of .a file with command
otool -hv libGcmLib.a
Apprarently following objects are not built against x86_64 architecture.
GCMSecureSocket.o
GtalkCore.pb.o
...
How do you build libGcmLib.a static lib ? Review it.

Related

Linker error after installing Firebase pod

I am a beginner in iOS app development. I am currently working on a project that needs to be changed from Parse to Firebase`.
I installed cocoa pods and "firebase/core" pod as firebase site instructed.
Imported firebase.h in appdelegate.h
Added [FIRApp configure]; in 'didfinishlaunchingwithoptions'
Added 'googleservice-info.plist' in project.
After doing these steps, I ran the build but it failed with following errors (Screen Shot)
Showing Recent Issues
Ld /Users/../Build/Products/Debug-iphonesimulator/Example.app/Example
Apple Mach-O Linker Error Group
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_FBAppCall", referenced from:
objc-class-ref in ParseFacebookUtils(PFFacebookAuthenticationProvider.o)
"_OBJC_CLASS_$_FBSession", referenced from:
objc-class-ref in ParseFacebookUtils(PFFacebookAuthenticationProvider.o)
"_FBTokenInformationExpirationDateKey", referenced from:
-[PFFacebookTokenCachingStrategy cacheTokenInformation:] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
-[PFFacebookTokenCachingStrategy expirationDate] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
-[PFFacebookTokenCachingStrategy setExpirationDate:] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
"_OBJC_METACLASS_$_FBSessionTokenCachingStrategy", referenced from:
_OBJC_METACLASS_$_PFFacebookTokenCachingStrategy in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
"_OBJC_CLASS_$_FBSessionTokenCachingStrategy", referenced from:
_OBJC_CLASS_$_PFFacebookTokenCachingStrategy in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
"_OBJC_CLASS_$_FBRequest", referenced from:
objc-class-ref in ParseFacebookUtils(PFFacebookAuthenticationProvider.o)
"_FBTokenInformationUserFBIDKey", referenced from:
-[PFFacebookTokenCachingStrategy facebookId] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
-[PFFacebookTokenCachingStrategy setFacebookId:] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
"_FBTokenInformationTokenKey", referenced from:
-[PFFacebookTokenCachingStrategy accessToken] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
-[PFFacebookTokenCachingStrategy setAccessToken:] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.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 know this has something to do with the parse code in my project but I don't have much knowledge in Parse or in Firebase.
Please help me with this error and guide me how to successfully migrate from Parse to Firebase.
If you used Parse SDK, just make sue you delete ParseFacebookUtils.framework library from your project or from your podfile remove
pod 'Parse'
pod 'ParseFacebookUtilsV4'

Stripe + Swift architecture arm64 error

I am trying to integrate Stripe with Xcode using Swift. I installed the podfile for Stripe and imported #import "Stripe.h" to my bridging file. All of other files in the bridge file work fine except Stripe. This is the error that i get when i initialize Stripe.setDefaultPublishableKey(""):
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_Stripe", referenced from:
type metadata accessor for ObjectiveC.Stripe in AppDelegate.o
"_OBJC_CLASS_$_STPPaymentCardTextField", referenced from:
objc-class-ref in STPCheckoutView.o
"_OBJC_CLASS_$_STPAPIClient", referenced from:
objc-class-ref in STPCheckoutView.o
"_OBJC_CLASS_$_STPCard", referenced from:
objc-class-ref in STPCheckoutView.o
"_StripeDomain", referenced from:
-[STPCheckoutView createToken:] in STPCheckoutView.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any help would be much appreciated.

"_OBJC_CLASS_$_MSClient", referenced from: objc-class-ref in AuthService.o

I git clone this ios project form
https://github.com/Azure/azure-mobile-services. That project is an example of using azure mobile service on ios. But when I compile it under XCode6, I get the follwing error:
ld: warning: ignoring file
/Users/JOHN/Src/iOS-MobileServices-Authentication/source/client/AuthenticationDemo/WindowsAzureMobileServices.framework/WindowsAzureMobileServices,
missing required architecture x86_64 in file
/Users/JOHN/Src/iOS-MobileServices-Authentication/source/client/AuthenticationDemo/WindowsAzureMobileServices.framework/WindowsAzureMobileServices
(3 slices) Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_MSClient", referenced from:
objc-class-ref in AuthService.o "_OBJC_CLASS_$_MSUser", referenced from:
objc-class-ref in AuthService.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code
1 (use -v to see invocation)
Does anyone know how to fix this?
Thank you.
In your project, build settings, set your valid architectures to just be "Standard Architecture (armv7, armv7s)" and not "Standard architectures (including 64-bit)"
and also set build active architecture only to No in all cases ie debug and release.
Currently the SDK is built with support for 5.1 which doesn't support a 64 bit build.

GPUImage issues running on simulator

So I've been trying to get GPUImage library to work in a project, and whilst it works on the device, does not work on simulator. I've tried in Xcode 5, using both Retina and non-retina simulators and get the following error:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_GPUImageBuffer", referenced from:
objc-class-ref in StartViewController.o
"_OBJC_CLASS_$_GPUImageVideoCamera", referenced from:
objc-class-ref in StartViewController.o
"_OBJC_CLASS_$_GPUImageView", referenced from:
objc-class-ref in StartViewController.o
"_OBJC_CLASS_$_GPUImageiOSBlurFilter", referenced from:
objc-class-ref in StartViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
My Build Settings are as follows;
I need for this to run on simulator as well as on device. I have tried making Build Active Architecture Only NO, as well as playing around with Valid Architectures, to have armv7 by itself, armv7 and armv7s, and just armv64, but to no avail.
Any help would be amazing.
Thanks in advance
Build Phases -> Link Binary With Libraries ...then add "GPUImage.framework", "libGPUImage.a"
I just deleted "arm64" from "Valid Architectures" and it works for me now. Maybe it helps.

Apple mach O linker Xcode iOS

Have this Error, plese send me code correct thanks
Loook code debug: http://textsnip.com/3jrghq (copy/pasted code below:)
symbols for architecture arm64:
"_OBJC_CLASS_$_PFUser", referenced from: objc-class-ref in LoginViewController.o
"_OBJC_CLASS_$_PFPush", referenced from: objc-class-ref in ParseExampleAppDelegate.o
"_OBJC_CLASS_$_PFInstallation", referenced from: objc-class-ref in ParseExampleAppDelegate.o
"_OBJC_CLASS_$_PFQuery", referenced from: objc-class-ref in ViewController.o
objc-class-ref in ParseExampleViewController.o
objc-class-ref in Buongiorno.o
objc-class-ref in ParseImageViewController.o
objc-class-ref in Compleanno.o
objc-class-ref in Buonanotte.o
"_OBJC_CLASS_$_Parse", referenced from: objc-class-ref in ParseExampleAppDelegate.o
(maybe you meant: _OBJC_CLASS_$_ParseImageViewController, _OBJC_CLASS_$_ParseExampleViewController , _OBJC_CLASS_$_ParseExampleAppDelegate , _OBJC_CLASS_$_ParseExampleCell )
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Thanks
If can please write code correct
Which version of Parse are you using? arm64 support was not included until v1.2.15 and you are trying to include it in an arm64 binary. I'd update the library version or just run it in the non-64 bit simulator.
Now the framework has been updated. You can have solutions of this warnings.
Just download the latest framework from this Link.
As of 1st Feb 2015, apple will not approve the apps without supporting architecture arm64.
In order to work this for parse, you have to update the framework.
This works for me. Hope it help someone else also.
Thanks...