Linker error after installing Firebase pod - objective-c

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'

Related

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.

Can't build GCM with Protobuf in Xcode

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.

Using Parse and Google Maps in the same app - conflict at linker flags -- iOS 7.1, Xcode 5.1

I have an app where first time I used PARSE. Then for second update, client requested GoogleMaps . When setup GMS, it said: " Choose your project, rather than a specific target, and open the Build Settings tab. In the Other Linker Flags section, add -ObjC. If these settings are not visible, change the filter in the Build Settings bar from Basic to All. "
If I set -ObjC to linker flags, I have this kind of errors from parse:
Undefined symbols for architecture i386: "_FBTokenInformationExpirationDateKey", referenced from:
-[PFFacebookTokenCachingStrategy cacheTokenInformation:] in Parse(PFFacebookTokenCachingStrategy.o)
-[PFFacebookTokenCachingStrategy expirationDate] in Parse(PFFacebookTokenCachingStrategy.o)
-[PFFacebookTokenCachingStrategy setExpirationDate:] in Parse(PFFacebookTokenCachingStrategy.o)
"_FBTokenInformationTokenKey", referenced from:
-[PFFacebookTokenCachingStrategy accessToken] in Parse(PFFacebookTokenCachingStrategy.o)
-[PFFacebookTokenCachingStrategy setAccessToken:] in Parse(PFFacebookTokenCachingStrategy.o)
"_FBTokenInformationUserFBIDKey", referenced from:
-[PFFacebookTokenCachingStrategy facebookId] in Parse(PFFacebookTokenCachingStrategy.o)
-[PFFacebookTokenCachingStrategy setFacebookId:] in Parse(PFFacebookTokenCachingStrategy.o)
"OBJC_CLASS$_FBAppCall", referenced from:
objc-class-ref in Parse(PFFacebookAuthenticationProvider.o)
"OBJC_CLASS$_FBRequest", referenced from:
objc-class-ref in Parse(PFFacebookAuthenticationProvider.o)
"OBJC_CLASS$_FBSession", referenced from:
objc-class-ref in Parse(PFFacebookAuthenticationProvider.o)
"OBJC_CLASS$_FBSessionTokenCachingStrategy", referenced from:
_OBJC_CLASS_$_PFFacebookTokenCachingStrategy in Parse(PFFacebookTokenCachingStrategy.o)
"OBJC_METACLASS$_FBSessionTokenCachingStrategy", referenced from:
_OBJC_METACLASS_$_PFFacebookTokenCachingStrategy in Parse(PFFacebookTokenCachingStrategy.o)
ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)
I found a solution to do not add Facebook in app and to use this kind of flag: -force_load
And after using this, I have also error: ld: file not found: clang: error: linker command failed with exit code 1 (use -v to see invocation)
I tried different types of using this, like : -force_load - the same error -force_load pathOfFramework/ - the same error
It is possible to give me a solution for this ?
Thanks a lot !
The problem is that parse has classes that it doesn't load if it doesn't need. For example, it only imports the Facebook classes if FacebookSDK is installed. -ObjC loads all of these, but they are dependent on FacebookSDK. When it can't find the files it needs, it throws errors:
Change:
-ObjC
To:
-force_load $(PROJECT_DIR)/GoogleMaps.framework/GoogleMaps
Source: Here

Objective C Video Player lots of errors

So On the simulator It works all perfect. No errors, nothing
Now I want to put it on my iPod and I get some unknow errors and I dont't know how to fix them.
-I have the MediaPlayer.framework and it is included in my build
Here is the error:
ld: warning: ignoring file /Users/NAME/Desktop/XCode/PROJECT/MediaPlayer.framework/MediaPlayer, file was built for unsupported file format which is not the architecture being linked (armv7)
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_MPMoviePlayerViewController", referenced from:
objc-class-ref in MoviePlayViewController.o
"_MPMoviePlayerDidEnterFullscreenNotification", referenced from:
-[MoviePlayViewController viewDidLoad] in MoviePlayViewController.o
"_MPMoviePlayerWillExitFullscreenNotification", referenced from:
-[MoviePlayViewController viewDidLoad] in MoviePlayViewController.o
"_MPMoviePlayerPlaybackDidFinishNotification", referenced from:
-[MoviePlayViewController viewDidLoad] in MoviePlayViewController.o
"_MPMoviePlayerPlaybackDidFinishReasonUserInfoKey", referenced from:
-[MoviePlayViewController playbackFinished:] in MoviePlayViewController.o
"_MPMoviePlayerWillEnterFullscreenNotification", referenced from:
-[MoviePlayViewController viewDidLoad] in MoviePlayViewController.o
"_MPMoviePlayerDidExitFullscreenNotification", referenced from:
-[MoviePlayViewController viewDidLoad] in MoviePlayViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Can anyone tell me what the error means and what I have to check? :)
Thanks
The only thing whcih is understandable for me is: unsupported file format.
It can't find the MediaPlayer.framework I believe is the problem. You need to update your Library Header Search Path in the build settings. It is looking for it on your desktop I believe.
You may need to add it to your target, relink it, or just make sure its pointing in the correct place.

ziparchive Objective-C arc compatible [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
error when import zlib in iOS: symbol(s) not found collect2: ld
I am working on iphone project and I need a library to extract ZIP file
I found ZipArchive but it doesn't compatible with ARC and when I add -fno-objc-arc to compile files I get linker error:
Undefined symbols for architecture i386:
"_inflateEnd", referenced from:
_unzCloseCurrentFile in unzip.o
"inflateInit2", referenced from:
_unzOpenCurrentFile3 in unzip.o
"_get_crc_table", referenced from:
_unzOpenCurrentFile3 in unzip.o
_zipOpenNewFileInZip3 in zip.o
"_crc32", referenced from:
_unzReadCurrentFile in unzip.o
_zipWriteInFileInZip in zip.o
-[ZipArchive addFileToZip:newname:] in ZipArchive.o
"_inflate", referenced from:
_unzReadCurrentFile in unzip.o
"deflateInit2", referenced from:
_zipOpenNewFileInZip3 in zip.o
"_deflate", referenced from:
_zipWriteInFileInZip in zip.o
_zipCloseFileInZipRaw in zip.o
"_deflateEnd", referenced from:
_zipCloseFileInZipRaw in zip.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
For the undefined symbols, you need to add libz to the linked libraries. See: error when import zlib in iphone sdk