0
votes

I'm trying to build my Unity game through XCode, but I'm having a lot of trouble with Firebase. First, I was getting lots of errors about missing references, because my Podfile was generated incorrectly by the editor. It was searching for the wrong versions of the plugin, as specified in the .xml files. I resolved that by removing the versions in the Podfile and launching 'pod repo update' and 'pod install'. After that, when I try to build again, I get this:

Undefined symbols for architecture armv7: "firebase::ReferenceCountedFutureImpl::ReleaseMutexAndRunCallback(unsigned long)", r eferenced from: void firebase::ReferenceCountedFutureImpl::CompleteInternal(unsigned long, int, char const*)::'lambda'(void*)>(unsigned long, int, char const*, void firebase::ReferenceCountedFutureImpl::CompleteInternal(unsigned long, int, char const*)::'lambda'(void*) const&) in libFirebaseCppInstanceId.a(instance_id_e6ccc884c5840734a302e2aabfa8925c.o) void firebase::ReferenceCountedFutureImpl::CompleteInternal, std::__1::allocator >, void firebase::ReferenceCountedFutureImpl::CompleteWithResultInternal, std::__1::allocator > >(unsigned long, int, char const*, std::__1::basic_string, std::__1::allocator > const&)::'lambda'(std::__1::basic_string, std::__1::allocator >*)>(unsigned long, int, char const*, void firebase::ReferenceCountedFutureImpl::CompleteWithResultInternal, std::__1::allocator > >(unsigned long, int, char const*, std::__1::basic_string, std::__1::allocator > const&)::'lambda'(std::__1::basic_string, std::__1::allocator >*) const&) in libFirebaseCppInstanceId.a(instance_id_e6ccc884c5840734a302e2aabfa8925c.o) ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)

If I remove armv7 as architecture and leave only arm64 I get the same error, but with an additional warning:

ld: warning: arm64 function not 4-byte aligned: _unwind_tester from /Users/user/Desktop/Unity - XCode/XWApp/Libraries/libiPhone-lib.a(unwind_test_arm64.o)

I tried everything I could, I don't know where to look anymore. Does somebody have an idea? Thank you.

2

2 Answers

1
votes

I should start by saying that you'll get much better technical support by either filing an issue on GitHub or using Firebase's support page. If you think you can isolate it to a dependency resolver issue, GitHub project works as well. It's just easier to have a back and forth with project setup in those contexts.

Now I'll mention some debug steps that may help:

Always use the latest version of the Firebase SDK if possible (currently 6.11.0). Regressions aren't super common, there are almost always bug fixes in each new version, and you can get really wacky compile or linker errors when you start mixing and matching Unity SDK versions.

It's always good to test Firebase features in isolation to ensure that there aren't any issues with your OS or Unity Editor, you can check out and build one of the quickstart applications. Since Firebase does a lot on iOS and Android to hook into the system libraries, it's possible to run into an issue with another plugin or a more esoteric editor setting. If you do reach out to support, I can almost guarantee that they'll ask you to do this anyway to help get good reproduction steps.

Next, you should generally let the Play Services Resolver do its thing for Podfile and workspace/project management in iOS. I did a fairly detailed writeup of what's happening behind the scenes, but to break it down:

Your first error is that you're missing ReferenceCountedFuture (note that all of the C++ SDK is open source, so you can look for anything that goes wrong at that layer). Since this is in the core, it's likely in libFirebaseCppApp (Assets/Plugins/iOS/Firebase/lib/FirebaseCppApp.a). You'll want to make sure that this is included in your iOS build on the Unity side and hasn't been excluded as some sort of build artifact by your version control system (this is super common).

Based on your comment, I think you know this much, but I'll include it for completeness for other readers. Other dependencies are pulled in via CocoaPods (these are the ObjectiveC level dependencies, your typical non-games SDK). These are in files that match the pattern *Dependencies.xml, and are generally located in Editor/ folders. These will not match Unity version (ex: 6.11.0), and are often a release behind the Firebase mainline. It's important that you don't go too far ahead in versions as issues will most likely manifest as compile or run time issues if the API changes.

I hope something here helps (if it does let me know), but if you think it's possible you've hit a bug definitely re-post in the channels linked above.

--Patrick

0
votes

I was able to fix that error by following the installation guidelines outlined in the Firebase docs here

  1. Install Firebase SDK (Follow every step on the guideline above)

  2. Make sure to add the Firebase Core library using the Package Manager

  3. In the PlayerSettings make sure you're using .NET 4.x Scripting Runtime Version

  4. After building the Xcode Project, open the PodFile and ensure the Firebase Library versions are the same as the ones in Unity Package managers

  5. Open your terminal in the Xcode project dir and run: pod install --repo-update