Undefined symbols for architecture arm64 "_OBJC_CLASS_$_SFSafariViewController" - ios

I am trying to integrate Google sign in into my iOS app. I have followed instructions mentioned by Google.
I have added SafariService.framework as well.
Still I am getting this error:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_SFSafariViewController", referenced from:
objc-class-ref in GoogleSignIn(GIDSignIn.o)
How to fix this issue?
Any ideas?
Thanks

I had the same issue. But my problem was i haven't included the SafariServices framework.
I added it as required and it worked fine.
Make sure you have the next configuration:
Disabled BITE_CODE
Added all needed frameworks
The linker flag -ObjC (not -Objc)
Added the needed url types
Imported GoogleSignIn.h
GoogleServices-Info.plist imported in your target
In my configuration i'm using 7.0 as deployment target
Hope it helps.
Regards

Since the SafariServices framework is only available on iOS9 and above, is it possible that you are trying to run this on a device with iOS lower than that? If so, is it possible that when you added the framework, you added it as required (making it impossible for the app to run on older versions of iOS)? Try setting it as optional (attaching an image to better explain what I mean).

Related

"Undefined symbols for architecture arm64" appearing after Unity FB SDK Update

Unity Version: 2020.3.25f1
XCode Version: 13.2.1
Unity FB SDK: Migrating from 11.+ to 14.0.0
After resisting updating the Facebook Unity SDK due to editor/ide related issues introduced in 13.2, was working to update to Unity Facebook SDK version 14.0.0. After resolving the standard issues to be in compliance with FB's updates (including client token in the FB Settings specifically and setting the DLLs to the correct build architecture), I had been able to build webgl and android without issue, but have encountered an iOS build fail.
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_ACAccountStore", referenced from:
objc-class-ref in Util.o
"_ACFacebookAppIdKey", referenced from:
_Util_getNativeFBPermissionStatus in Util.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Reading through the various other issues hitting a similar Undefined symbols for architecture blah makes me think I might either be missing something in my linker settings, or potentially missing a framework I need to reference. Originally I had assumed it was something happening during archiving, but the same error shows when just trying to build the xcode project. The pod file builds successfully and resolves without issue, so the xcode workspace is being built.
EDIT: Adding a little more info, I had already done the dll import settings solution suggested.
This is solved by: https://github.com/facebook/facebook-sdk-for-unity/wiki/FAQ---Troubleshooting-Unity-SDK-14.0.0
Your issue is "Issue 2: dlls misconfiguration"--for completion's sake, below is the solution in its entirety. I'm leaving the misspellings and bad grammar below just to emphasize how sloppy these guys are.
"Solution:
This is an indication of mis-configuration of dlls in Unity. When Unity SDK is imported into Unity, unfortunately Unity reconfigures all dlls to 'All Platforms' and this causes an issue when building on a particular platform. The way to resolve this, is to reconfigure the dlls. You will find them in Unity under FacebookSDK -> Plugins and all the dlls are under their various platform folders such as Android / Canvas / Editor / iOS etc. Click on them and an inspector will appear (attached screenshot). The example attached shows the configuration for an Android dll. Uncheck All Platforms (if needed) and select Android. Do the same for the rest:
Android.DLL to Android platform
IOS Dll to iOS platform
Canavs to webgl"
Edit: As noted additionally below if you aren't building for Windows (or any of the other platforms), just delete those folders. Regardless you will HAVE to delete the Windows x86 folder if you want your build to work on mobile.
After getting some input from an engineer that had worked on this project in the past, managed to find that the missing symbol was related to some old FB Code no longer supported, and it was not in use by our app anymore. Because of this, was able to cleanly remove the old code and resolve the build issue. Things appeared to be working as intended. For visibility, we had an internal class using some extern methods to bridge between our app code and the native code pertaining to platform. iOS had a method getNativeFBPermissionStatus that was part of a Util.m class.

Missing 64-bit Support and Lipo Error!! can't open input file in Xcode 6.3

I downloaded Xcode 6.3 and while Submitting App to the App Store,I'm getting following error's.
In My Build Setting Architecture, If I'm using Build Active Architectures Only to YES
Then I m getting this Error -
lipo Error!! can't open input file.
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/lipo: can't open input file: /Users/XYZ/Library/Developer/Xcode/DerivedData/MyAPP-hjbmqpnmsoruqxbwlayqkjsojccv/Build/Intermediates/MyAPP.build/Debug-iphoneos/MyAPP.build/Objects-normal/armv7s/MyAPP.
If I'm setting Valid Architecture to armv7
I am getting following error while submitting app to AppStore-
You are likely using a library that does not support 64 bit. If this is what's causing the problem, you can fix it by updating the library.
The check for this, look at your compiler errors, to see if any point to a third-party library that you're using. They would look something like this:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_THIRD_PARTY_CLASS_NAME", referenced from:
objc-class-ref in YOUR_CALLING_CLASS.o
Don't change the setting for Build Active Architecture Only. This should be set to NO for the App Store build, unless you are certain that you only want to build for a device with the exact same architecture as listed in your project settings.

Xcode - unidentified symbols for architecture archs in libpjmedia-codec-arm-apple-darwin9.a(opencore.o)

I really having a hard time to figure out the problem.
i'm using PJSIP and also opencore-amr.
successfully compiled opencore-amr to arm64 (lipo -info told me)
successfully integrate opencore-amr (arm64) with PJSIP
(arm64),configure it, make dep, make clean and make without any
error.
when i try to compile it with XCode. it says
Undefined symbols for architecture arm64:
"_Decoder_Interface_Decode", referenced from:
_amr_codec_decode in libpjmedia-codec-arm-apple-darwin9.a(opencore_amr.o)
I did ar-t libpjmedia-codec-arm-apple-darwin9.a and the opencore.o inside the library is arm64.
I really have no clue to solve this.
please help me, thanks
FYI : I've tried open core with pjsip for android, and no issue at all.
This is the linker error, you probably forgot to link some library. Go to Project settings -> Build phases -> Link Binary with Libraries section and review it. Try to google which framework contains the classes mentioned in error log and then add it to frameworks list.

iOS7 Compatibility with Xcode 6

I want to make my iOS8 app compatible with iOS 7.0 but, it gives the following error log.
By referring previous questions, I have tried re-adding certain frameworks and making them optional to no avail. Please help me here.
dyld: Symbol not found: _OBJC_CLASS_$_CIKernel
Referenced from: /var/mobile/Applications/3F71E632-C303-4C7E-9DA5-BE70B8D2C8FD/xxxxx.app/xxxxx
Expected in: /System/Library/Frameworks/CoreImage.framework/CoreImage
in /var/mobile/Applications/3F71E632-C303-4C7E-9DA5-BE70B8D2C8FD/xxxxx.app/xxxxx
Try setting CoreImage.framework as optional in the Linked Frameworks and Libraries section under General Tab.

App crashes on iOS 6: Symbol not found: ___sync_fetch_and_add_4

I have an application that works perfectly with iOS4 and iOS5. It uses a statically compiled version of the zeromq library, targeted for ARM. Apple denied my application because they claim it crashes under iOS 6 (yet unreleased..wth?)
After trying it with the iOS 6 GM I can confirm it does crash when we initialize the ZeroMQ socket. Here is the crash messages:
dyld: lazy symbol binding failed: Symbol not found: ___sync_fetch_and_add_4
Referenced from: /var/mobile/Applications/00EDEEDA-0068-4061-9188-01D627F9A6D6/OpenAir.app/OpenAir
Expected in: /usr/lib/libSystem.B.dylib
dyld: Symbol not found: ___sync_fetch_and_add_4
Referenced from: /var/mobile/Applications/00EDEEDA-0068-4061-9188-01D627F9A6D6/OpenAir.app/OpenAir
Expected in: /usr/lib/libSystem.B.dylib
I understand the __sync_fetch_add_4 symbol is a compiler atomic builtin. I know that ZeroMQ is using mutexes for it's internal locking. I have been searching everywhere to try to figure out what changed in iOS6 that could cause these symbols not to be present.
Using Xcode 4.5 and iOS6 GM, the library will not even compile with the same type of message:
Undefined symbols for architecture armv7:
"___sync_fetch_and_add_4", referenced from:
zmq::socket_base_t::unregister_session(std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > const&)in libzmq.a(libzmq_la-socket_base.o)
Is there a way to disable atomic builtins in the Apple compilers to try to bypass this problem altogether?
Make sure you aren't targeting any iOS below 4.3. Same goes for your static library, you will need to rebuild these. Also, make sure to remove armv6 from Archs and add armv7s is it does not exist.
After upgrading to Xcode 4.5, I tried everything for 2 days, and nothing worked. I finally gave up and went back to using Xcode 4.2.1
open -a /Developer/Applications/Xcode.app
Just to clarify. I've run my app on iOS 6 by building using the iOS 5 SDK. so unless you need iOS 6 functionality immediately, that works.
It shouldn't really be necessary to downgrade to an early version of iOS. I think the key is to use the extra bindings that are available for C and objective C development:
http://czmq.zeromq.org/
http://www.zeromq.org/bindings:objc
I used the czmq ones and can confirm these build with xcode in an iOS 6 project. I spent some time trying to get these to work as there's not much documentation on using them with iOS SDKs, but found the easiest method was to:
Download zeromq from http://download.zeromq.org/zeromq-3.2.2.tar.gz, extract, configure and build from the command line.
Download czmq from the link above and extract.
Import the src and include paths from the above into an xcode project.
Add -lstdc++ to the 'Other Linker Flags' section under 'Build Settings' for your target project
Import "czmq.h"
The libraries should successfully link together, then you should be good to go!

Resources