-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Crashlytics does not generate build id and crashes Android build at startup #918
Comments
I took a look at this and notice you're only seeing the tool failure for iOS, but your issue is on Android. The Firebase Unity plugin has a different process for generating the You can add a keep rule like this: https://github.com/firebase/firebase-android-sdk/blob/master/firebase-crashlytics/src/main/res/raw/firebase_crashlytics_keep.xml to your Android build. Or simply wait for the next version of Crashlytics which will include this keep rule automatically to deal with an upcoming change in the default behaviour of R8. |
That's not an accurate description of the issue. Since the Unity iOS Module is not installed, the The proposed workaround perfectly solves the issue. |
Ok got it.
Since the workaround works, then the next release of the Unity plugin that includes the latest Crashlytics will resolve this issue, and you'll be able to remove the workaround. I'll close this for now since the workaround is working. Feel free to file a new issue if you run into the issue on the future version, and it might be better to file it in https://github.com/firebase/firebase-android-sdk if it is Android specific. |
[REQUIRED] Please fill in the following fields:
[REQUIRED] Please describe the issue here:
I have a correctly set project that works for both platforms if built locally, but does not work when built by CI, and that is because the CI runner is a Linux machine with only the Android module installed. As described by unity-jar-resolver#412, the packages require the Unity iOS module to be installed, otherwise might cause issues when building. That is the exact case that happens on my CI setup.
Since my CI runner does not have the iOS Module, the
Firebase.Crashlytics.Editor.dll
can't be loaded and therefore cannot generate a crashlytics build id at build time, resulting in a crash with the following error on build:The Crashlytics build ID is missing. This occurs when Crashlytics tooling is absent from your app's build configuration. Please review Crashlytics onboarding instructions and ensure you have a valid Crashlytics account.
Steps to reproduce:
Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)?
What's the issue repro rate?
What happened? How can we make the problem occur?
Locally
Ensure you have the
Firebase Crashlytics
package installed, you do not have the Unity iOS Module installed, and clear your project's Library folder. Then, build the unity project from the command line.On CI
Make sure you have the
Firebase Crashlytics
package installed. Run a build job for Android with alinux-android
runner.The outcome
Observing the build log, regardless of the way you built the app, you'll see the error:
This will prevent the crashlytics build id from being generated at build time. And will ultimately crash the Android build at startup.
Our Workaround
We import the Firebase packages through .tgz and embed them into our repository for local UPM reference. So, to effectively workaround the issue:
.tgz
package file to a folder. In my case, they were:Packages/com.google.external-dependency-manager/ExternalDependencyManager/Editor/<version>/Google.IOSResolver.dll
Packages/com.google.firebase.crashlytics/Firebase/Editor/Firebase.Crashlytics.Editor.dll
Packages/com.google.firebase.app/Firebase/Editor/Firebase.Editor.dl
.dll.meta
and.pdb.meta
files (for exampleFirebase.Editor.dll.meta
) and add the line:PluginImporter: serializedVersion: 1 iconMap: {} executionOrder: {} isPreloaded: 0 + validateReferences: 0 platformData:
package.json
file lives) and runnpm pack
on the terminal (make sure to install node if you don't have it).tgz
package you can replace in your projectYou can tell when a build will work when you find this line in the build logs (I usually just ctrl + F "generated resource"):
Final Considerations
Our workaround is not the ideal way to fix the issue permanently. I believe that any platform-specific code should only be compiled if the platform is available, be that by constraining the assembly to a single platform, or by using
UNITY_IOS
orUNITY_ANDROID
preprocessor directives.The original issue on the unity-jar-resolver repository is 2 years old, and that is somewhat revolting. I understand that there are more urgent fixes and features on the line, but can it have some attention, please? It's ironic that an SDK to detect crashes ultimately causes your game to crash at startup because it was unable to find an id that itself was responsible for generating.
The text was updated successfully, but these errors were encountered: