1

Firebase 6.15.2

Unity 2019.4

Xcode 11.6

OSX Catalina 10.15.6

Hi there,

Relative newbie, so apologies if I’m missing anything obvious here…

I’m attempting to build a unity project for iPhone using Firebase, using cocoapods. I'm only using Firestore within the project. I keep getting the following set of errors when building to a device,

Undefined symbol: firebase::auth::User::GetToken(bool)
Undefined symbol: firebase::auth::AuthStateListener::~AuthStateListener()
Undefined symbol: firebase::auth::Auth::AddAuthStateListener(firebase::auth::AuthStateListener*)
Undefined symbol: firebase::auth::Auth::current_user()
Undefined symbol: firebase::g_auth_initializer
Undefined symbol: typeinfo for firebase::auth::AuthStateListener
Undefined symbol: firebase::auth::Auth::GetAuth(firebase::App*, firebase::InitResult*)

I’ve tried all of the suggestions in this thread : iOS - Firebase Undefined symbols for architecture x86_64 - Stack Overflow

And am at a loss as to what to try next, besides smashing my head into the desk one more time.

Any pointers would be hugely appreciated!!

2 Answers2

0

A good thing to remember with the Unity SDK is that it's different enough from the iOS SDK that the specific fixes there might mess with the games tooling a little bit.

When you export, EDM4U should auto-generate a Podfile and run install for you. So make sure you just go straight to the xcworkspace rather than opening the xcproj. If you're successfully running pod install for example on the generated project, then CocoaPods should already be setup enough for this to not be the issue.

Now the linker errors you're getting are part of the C++ SDK. This is the middle layer of the SDK:

|                Unity (C#)                                 |
|-----------------------------------------------------------|
|                   C++                                     |
|-------------------------------------------                |
| Android (Java/Kotlin) | iOS (ObjC/Swift) |  Desktop (C++) |

These files you're looking for on iOS are .a files in Assets/Plugins/iOS. If you're not using the Unity Package Manager, make sure you haven't removed these (.a is a common exclusion pattern for version control) - and try re-adding the SDK if you have. For the Unity Package Manager, it should just work - you can try deleting the Library directory with Unity closed and let Unity regenerate this (pulling down the packages in the process). I believe that the file you're missing is libFirebaseCppAuth.a, although whatever is causing an issue here could be affect the other .a files that are needed.

If the file is included, ensure that it's included in your iOS build:

screenshot of the "Select platforms for plugins" panel for libFirebaseCppAuth.a with iOS selected

LMK if that helps!

Patrick Martin
  • 2,993
  • 1
  • 13
  • 11
0

I had the same problem and solved it by adding the Firebase Authentication package on my Unity Project.

I don't use any authentication on my game, so it is a workaround that solved my problem. I think there's a bug on Firebase core requiring these authentication package.

Bivis
  • 1,320
  • 1
  • 10
  • 24