Firebase Unity - Undefined Symbol errors for iOS - ios

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!!

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:
LMK if that helps!

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.

Related

iOS WebRTC framework compiling not working the same as cocoa pods

The 'main' google webrtc library from cocoa pods is
https://cocoapods.org/pods/GoogleWebRTC
I have found it to be different in subtle functionalities (REMB and simulcasting) than the gClient built framework with the webRTC repo.
The directions I've followed are these
http://webrtc.github.io/webrtc-org/native-code/ios/\
My instinct is it's simply an argument issue when building the framework. Does anyone know what args google uses when compiling this?
Sorry I don't know the solution, but please don't use the cocoa pods! It hasn't been updated since October 2019 and has grave security vulnerabilities. CVE-2020-6514
Project Zero was able to get a RCE with it you can read more here

Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_MobilePayManager"

I know there is a lot of similar errors out there, but i tried doing exactly what the answers said, and nothing helped.
I have now even created a completely new DemoProj (React-Native app), linked the repository the error is in, and i STILL get the same error.
The repository can be found here: https://github.com/Renetnielsen/DemoProj
If one fetches it and runs xcode, and runs that, you would get the same error.
I have no solution to this what so ever, especially since im no Objective C programmer.
Please please help me!!
The module react-native-appswitch is a small 2 function module, that just exports some IOS SDK functionality (https://developer.mobilepay.dk/appswitch-integration)
Complete Stacktrace: https://github.com/Renetnielsen/DemoProj/blob/master/README.md
Solutions tried
- Create completely new app, refered repo, installed, got error
- Ran on device, same error.
- Cleaned build folder, pods and so on - still error
- Linking binary files and so on
It needs to be fixed using 64 bit architecture, so using 32 is not an option, since ios does not support that any more as far as i know.

Compiling error using llvm clang in iOS (on device,jailbreaken)

how can I fix this error?:
http://i.stack.imgur.com/zmZea.jpg
I got this error when compiling a simple c++ file but I don't know why
When I compile this file with iOS 6.1 sdk it works but I want it to work in iOS sdk 8.1
My iPad:ipad 3 wifi
My iOS version:8.4
It shouldn't be problem with the architecture. As far as I know Apple hasn't changed Armv7. From what I see, its a linker error, probably caused by libraries not being linked in correctly. Pretty clear when it says: ignoring nonexistent library. This type of error could occur if you import a header and fail to link it against the correct library OR if you just straight up include a header for the wrong architecture -_-.
So thats the diagnosis. I guess the rest of the hacking is up to you since no one here has any clue what you have done to the poor iPad.

Flex ANE, iOS and ARC

Good day
I have created a static library with Xcode. Then I compiled my ANE using adobe's ADT tool. Thereafter I've included the ANE in my FlashBuilder project. However, when attempting to package my project, I get the following error:
"Error occurred while packaging the application:
Undefined Symbols: "_obj_storeStrong", referenced from ...
.
"_obj_release", referenced from ...
.
"
My guess is that ARC is probably not supported for ANE's. I'm guessing that this is probably due to the fact that FlashBuilder is recompiling the entire AIR + the native libs into one iOS application, probably using their own compiler or something (which is why Air apps for iOS can be compiled on windows platforms as well), and this compiler is probably not 4.3 ready yet?
I have attempted adding the flag -fobjc-arc to my ios-platformoptions.xml as well (where this file is the parameter to the -platformoptions flag of adt), but still no joy. It results once again in an error when packaging. Perhaps any other flag I can try to use here?
Any corrections, suggestions, alternative ideas or comments will be most welcome. I am very new to Xcode, Objective C and ANE, so please excuse any incorrect statements or assumptions, and please correct me on these.
I would be glad if somebody can please confirm weather I am correct with my assumption that I cannot use ARC at this stage on ANE's.
Thanks
Christo
START EDIT:
Very late update, sorry.
You might be able to use ARC after all. There is a library called arc lite that I forgot to mention and it works. I created an ANE for MapKit on iOS targeting the 5.0.x SDK. When I tried to move to a device that only had 4.3.x ( could have been 4.3.3 or 4.3.5 ) the app crashed or would not compile. I found information on the arc lite library that is included in the newer sdks, followed the instructions on how to include this library and pow! A working ANE on a 4.3.x device without rewriting my code!
Hope all of this helps and half of my original comment :)
Markus
END EDIT
I don't think ARC is supported just yet. There isn't much to go on in terms of settings or examples of what the settings should be in Xcode. Take a look at any of the Xcode ANE projects you can get your hands on. You will see that most or all of the projects have:
Object-C Automatice Reference counting = NO
Objective-C++ Automatic Reference counting = NO
Take a look at the following:
Vibration ANE - On Adobe Devnet site
Liquid Photo - http://www.liquid-photo.com/2011/10/30/common-native-extension-issues/
Liquid Photo - http://www.liquid-photo.com/2011/10/28/native-extension-for-adobe-air-and-ios-101/
There are a lot of examples in Github but you have to find them via Google. Pull down the Xcode ANE projects and compare the settings.
Hope this helps!!!
Markus

Xcode Error - missing required architecture i386 in file

I'm trying to compile a demo project from Unity in Xcode (it's actually a tutorial on a new Augmented Reality platform that integrates with Unity called String) and getting this error:
ignoring file libiPhone-lib.a, missing required architecture i386 in file
I've researched this a little, and it seems to be some sort of issue with what version of iOS you're deploying too, but I'm not sure. Regardless, I've tried to deploy to different versions, and they all result in this error.
Any ideas how to fix this?
I did some research and it seems Unity for iPhone doesn't deploy on simulator. It only works on device or in the Unity editor. Check out this link. Hope it helps.

Resources