firebase-unity-sdk: [Bug] Incremental firebase Unity-iOS builds reset code signing on gRPC-Certificates
[REQUIRED] Please fill in the following fields:
- Unity editor version: 2022.2.x (currently .2.8)
- Firebase Unity SDK version: 10.3.3 - 10.3.5
- Source you installed the SDK: UPM (.unitypackage or Unity Package Manager)
- Problematic Firebase Component: Build System, but assuming Auth is source. (Auth, Database, etc.)
- Other Firebase Components in use:Project includes Auth, RTDB, Firestore, Storage (Auth, Database, etc.)
- Additional SDKs you are using: None (Facebook, AdMob, etc.)
- Platform you are using the Unity editor on: Mac (Mac, Windows, or Linux)
- Platform you are targeting: iOS (iOS, Android, and/or desktop)
- Scripting Runtime: il2cpp (Mono, and/or IL2CPP)
- Pre-built SDK from the website or open-source from this repo: Prebuilt Official Google Package Archive
[REQUIRED] Please describe the issue here:
Iterating on iOS Unity builds of firebase projects seems to have regressed over the last couple of years, in that.
Specifically:
-
By default, Unity still enables bitcode, but the generated XCWorkspace doesn’t build the pods with bitcode. This isn’t a huge hassle (either script to disable bitcode or do it once and your local project will then be good until you rebuild from scratch.)
-
More annoyingly, every single incremental Unity “Build-and-Run” build un-sets the signing certificates for gRPCCertificates-CPP, requiring (proably) 3 extra clicks in the XCode UI to resolve. This is the case even if you have set your development team directly in Unity’s Editor settings.
It would be great if incremental builds of Firebase could have their painless iteration restored (it’s been a while since I was working on a Firebase project, but from memory Firebase 7.x didn’t have these issues?)
Steps to reproduce:
(a) Create a firebase project with the above components. Fix signing, bitcode, etc errors whilst building in latest XCode (14.2 at time of writing) (B) Build and Run on device. © Incrementally build a change (Command+B in Unity) (d) Observe that XCode project will have no signing certificate for GRPC-certificates, so you’ll have to fix this manually (3 mouse clicks, and a scroll down to find the actual error in xcode’s gargantuan list of warnings)
Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)? What’s the issue repro rate? (eg 100%, 1/5 etc)
100%
What happened? How can we make the problem occur?
- Expected: Incremental build of application builds, deploys to device and runs.
- Actual: Incremental build in Unity succeeds, which then invokes XCode, which fails with an error saying “grpc-Certificates requires a signing identity.”
If you have a downloadable sample project that reproduces the bug you’re reporting, you will likely receive a faster response on your issue.
This can be reproduced on a blank project with the above packages.
// TODO(you): code here to reproduce the problem
About this issue
- Original URL
- State: open
- Created a year ago
- Comments: 22 (2 by maintainers)
This solution fixed it for us: https://forum.unity.com/threads/ios-failed-to-archive-on-xcode-14-1-14-2.1416096/#post-8929385
Yeah, the bitcode thing is definitely outside our control. Looking more into the gRPC issue, I’m still struggling to see where exactly the problem lies, if it is something in the Firebase iOS side, or the gRPC side, but am reaching out to folks. We could potentially add a workaround in the Unity SDK, though I’m not entirely sure what the other implications of adding that code block might have to projects.
Thanks for confirming. My personal feeling is that this issue should focus only on the gRPCCertificates issue, because that’s the one that’s disruptive to build workflow and nontrivial (as pointed out by @a-maurice above) to fix locally.
In retrospect, I wish I hadn’t mentioned bitcode. The bitcode issue is a result of Unity’s decision to have bitcode on by default (which although Apple’s recommendation doesn’t align with anyone’s reality). Also disabling bitcode can be done by by adding an OnPostprocessBuild step to the unity project. Why there still isn’t a “disable bitcode” option in PlayerSettings (or just disable it by default) I don’t know, but a fix like this solves the bitcode issue permanently.
https://support.unity.com/hc/en-us/articles/207942813-How-can-I-disable-Bitcode-support-