0

I've been really struggling with this one.. for days now... I've made an app using Unity (and Firebase), build an IOS build (without CocoaPods, so I've imported the frameworks later in the Xcode, has Firebase said in Step 4 here: https://firebase.google.com/docs/ios/setup#frameworks) Till now, all good. I've opened the .xcodeproj using Xcode, filled up my app's info, tried to build an archive and got this error:

ld: warning: arm64 function not 4-byte aligned: _unwind_tester from /Users/dor/Desktop/PullApp-1.0.0/Libraries/libiPhone-lib.a(unwind_test_arm64.o)
Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_FIRApp", referenced from:
      objc-class-ref in libFirebaseCppApp.a(app_ios_814e1620d4f88024cea4bade26623a67.o)
  "_OBJC_CLASS_$_FIRTransactionResult", referenced from:
      objc-class-ref in libFirebaseCppDatabase.a(database_reference_ios_0c4ba7507f304dd9e420c9763efbc13d.o)
  "_OBJC_CLASS_$_FIRDatabase", referenced from:
      objc-class-ref in libFirebaseCppDatabase.a(database_ios_e51dee2718c2fa50bb12fbc46a002ec6.o)
  "_OBJC_CLASS_$_FIRGameCenterAuthProvider", referenced from:
      objc-class-ref in libFirebaseCppAuth.a(credential_ios_7e32949a14fe9694040ff5eed8d1b954.o)
  "_OBJC_CLASS_$_GKLocalPlayer", referenced from:
      objc-class-ref in libFirebaseCppAuth.a(credential_ios_7e32949a14fe9694040ff5eed8d1b954.o)
  "_OBJC_CLASS_$_FIRGoogleAuthProvider", referenced from:
      objc-class-ref in libFirebaseCppAuth.a(credential_ios_7e32949a14fe9694040ff5eed8d1b954.o)
  "_OBJC_CLASS_$_FIRPhoneAuthProvider", referenced from:
      objc-class-ref in libFirebaseCppAuth.a(credential_ios_7e32949a14fe9694040ff5eed8d1b954.o)
  "_OBJC_CLASS_$_FIRPhoneAuthCredential", referenced from:
      objc-class-ref in libFirebaseCppAuth.a(user_ios_1b162c7ca01af7914d8255750deffbf0.o)
  "_OBJC_CLASS_$_FIROptions", referenced from:
      objc-class-ref in libFirebaseCppApp.a(app_ios_814e1620d4f88024cea4bade26623a67.o)
  "_OBJC_CLASS_$_FIROAuthProvider", referenced from:
      objc-class-ref in libFirebaseCppAuth.a(credential_ios_7e32949a14fe9694040ff5eed8d1b954.o)
  "_OBJC_CLASS_$_FIRConfiguration", referenced from:
      objc-class-ref in libFirebaseCppApp.a(log_ios_dd26aec5b8537064a4c15d38b58b4640.o)
  "_OBJC_CLASS_$_FIRFacebookAuthProvider", referenced from:
      objc-class-ref in libFirebaseCppAuth.a(credential_ios_7e32949a14fe9694040ff5eed8d1b954.o)
  "_OBJC_CLASS_$_FIRDatabaseReference", referenced from:
      objc-class-ref in libFirebaseCppDatabase.a(database_reference_ios_0c4ba7507f304dd9e420c9763efbc13d.o)
  "_OBJC_CLASS_$_FIREmailAuthProvider", referenced from:
      objc-class-ref in libFirebaseCppAuth.a(credential_ios_7e32949a14fe9694040ff5eed8d1b954.o)
  "_OBJC_CLASS_$_FIRGitHubAuthProvider", referenced from:
      objc-class-ref in libFirebaseCppAuth.a(credential_ios_7e32949a14fe9694040ff5eed8d1b954.o)
  "_OBJC_CLASS_$_FIRTwitterAuthProvider", referenced from:
      objc-class-ref in libFirebaseCppAuth.a(credential_ios_7e32949a14fe9694040ff5eed8d1b954.o)
  "_OBJC_CLASS_$_FIRAuth", referenced from:
      objc-class-ref in libFirebaseCppAuth.a(auth_ios_b54468d60a10f4f18faae0e528a8c0ba.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

What solutions did I try and still failed to make an archive? - In the "other linkers" I've put "-ObjC". - Changed the architectures to "standard architectures" (Don't know what it does but that's one of the many solutions my good friend google has recommended me). - Made sure I've put the "-ObjC" both on the project's and the target's Build Settings (since this is repeatedly written in the error's message).

This^ is the solutions I was able to find online.. still nothing... I could find anything really matching my exact error here on the website nor anywhere really... Any ideas before I completely give up on IOS..?

2 Answers 2

1

[Edit - summarizing comments after this answer]

The issue is that the Unity SDK was out of date, see this page for the latest version.

Also, you should be able to follow just the Unity getting started instructions. The iOS getting started instructions are only applicable for iOS native games and applications (the Unity SDK attempts to perform all the necessary actions through the included External Dependency Manager for Unity).

[Original Answer]

I think I see what's happening here, note that the files that are missing all have Cpp in their name. The Unity SDK is built on top of the C++ SDK and you're missing all of those dependencies. These were included in the initial unitypackage you installed, so you might want to double check to make sure that you haven't accidentally deleted the .a files there (often times they're ignored as "build artifacts" by version control software).

With that in mind, unless you're doing something interesting with Firebase (ex: your own Unity bindings or maybe playing with embedding Unity into an iOS app) or just really really don't trust CocoaPods, you should let the External Dependency Manager for Unity handle resolving the iOS libraries. This ships with the Firebase Unity SDK, and should just work. I did a brief writeup here (when it was still called the Play Services Resolver), and will hopefully clear up any uncertainties you have.

These are all my current (working) settings: Screenshot of my EDM4U iOS settings window

Note with the way I've configured it, I need to open up the xcworkspace rather than the xcproj that you're used to. That is configurable via the Cocoapods Integration dropdown.

Let me know if you have any more questions!

--Patrick

Sign up to request clarification or add additional context in comments.

15 Comments

First of all - THANK YOU SO SO SO MUCH !!! I'm stuck with implementing my app to IOS for over 14 days !! I have such a headache hahaha. Ok, so I've read all you've written (also the article, which was very insightful, so thanks again ^_^ ) and I've decided to go with your approach - with CocoaPods and the Resolver. So, I've created a new build from Unity, using your exact settings in the IOS Resolver. The build was successful (YAY) but, I also saw this error in the console: (in the next comment)
"iOS framework addition failed due to a CocoaPods installation failure. This will will likely result in an non-functional Xcode project. After the failure, "pod repo update" was executed and succeeded. "pod install" was then attempted again, and still failed. This may be due to a broken CocoaPods installation. See: guides.cocoapods.org/using/troubleshooting.html for potential solutions." (Countinue in the next comment)
"pod install output: Analyzing dependencies [!] CocoaPods could not find compatible versions for pod "Firebase/Analytics": In Podfile: Firebase/Analytics (= 5.15.0) None of your spec sources contain a spec satisfying the dependency: Firebase/Analytics (= 5.15.0). You have either: * out-of-date source repos which you can update with pod repo update or with pod install --repo-update. * mistyped the name or version. * not added the source repo that hosts the Podspec to your Podfile."
I've tried all the console's solutions, still nothing. I did notice something strange, I tried, few times, to modify the pods in the podfile and removed the version of each pod, and then I've tried to build the game again, but, the same exact error poped up, so i went to the podfile again, and saw that the pods versions were all back. something reseted it, but i don't know what and if it really matters.. hope you could help me, thanks again about everything, i do, really, appreciate it (^_^)
Hm, that's interesting. Is there a chance that you have different versions of the Firebase Unity SDKs installed? You can also try just wiping out your build directory and letting it regenerate. If you have success with different versions of libraries in the Podfile, definitely report that to github.com/firebase/quickstart-unity/issues. Generally you shouldn't touch the Podfile at all, and let the resolver do its thing. If you need new pods, creating a Dependencies.xml will ensure that your changes don't get erased (mentioned in that article I linked).
|
1

This link helped me to solve issue: https://github.com/facebook/facebook-sdk-for-unity/issues/504.

But I had only one from your errors (Probably Firebase Problems):

objc-class-ref in libFirebaseCppApp.a(app_ios_814e1620d4f88024cea4bade26623a67.o)

which caused

ld: warning: arm64 function not 4-byte aligned: _unwind_tester from /Users/XXX/XXX/XXX/XXX/YYYY/Build_iOS/Libraries/libiPhone-lib.a(unwind_test_arm64.o) Undefined symbols for architecture arm64: "OBJC_CLASS$GKLocalPlayer"...

I manually added GameKit.framework with following steps :

UnityFramework (The one with yellow icon under your target) -> Build Phases -> Link Binary With Libraries (Scroll Till end and you will find the + button, press it and write in search "GameKit.framework")

enter image description here

Hope it helped someone, because I lost hours to find solution for this issue.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.