WorryFree Computers   »   [go: up one dir, main page]

Skip to content
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 not sending crashes to the console when using *.tgz and UPM #1116

Closed
jamier-hh opened this issue Aug 18, 2021 · 16 comments
Closed

Comments

@jamier-hh
Copy link
jamier-hh commented Aug 18, 2021

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2019.4.26f1
  • Firebase Unity SDK version: 8.1.0
  • Source you installed the SDK: UPM
  • Problematic Firebase Component: Crashlytics
  • Other Firebase Components in use: Core, Analytics
  • Additional SDKs you are using: Facebook, AppLovin MaxSDK
  • Platform you are using the Unity editor on: Mac
  • Platform you are targeting: iOS
  • Scripting Runtime: IL2CPP

[REQUIRED] Crashlytics not sending crashes to the console:

I wasn't sure where to add this issue. It seems to be specific to Unity when using iOS. Whenever including Crashlyitcs via UPM using *.tgz, Crashlytics does not seem to initialize properly and crashes will not get sent to the console. I've tried installing them via our custom registry as well directly in the project and it does not seem to make a difference.

Using the same GoogleService-Info.plist file, I've been able to send reports when using the *.unitypackage version of Crashlytics. I've removed my test *.plist for privacy purposes.

Steps to reproduce:

  1. Open attached project.
  2. Add the following tarball to the Packages folder: com.google.firebase.crashlytics-8.1.0.tgz, com.google.external-dependency-manager-1.2.166.tgz, com.google.firebase.analytics-8.1.0.tgz, com.google.firebase.app-8.1.0.tgz
  3. Add the GoogleService-info.plist to the Assets/* folder.
  4. Build for iOS
  5. Deploy to device. Crashes should happen automatically.
  6. Check the console and see no crashes.
    Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)?
    What's the issue repro rate? 100%

What happened? How can we make the problem occur?
No errors are reported to the Crashlytics dashboard.

If you have a downloadable sample project that reproduces the bug you're reporting, you will
likely receive a faster response on your issue.

TestingPackages.zip

@paulinon paulinon removed the new New issue. label Aug 18, 2021
@jamier-hh jamier-hh changed the title [Bug] [Bug] Crashlytics not sending crashes to the console Aug 18, 2021
@jamier-hh jamier-hh changed the title [Bug] Crashlytics not sending crashes to the console [Bug] Crashlytics not sending crashes to the console when using *.tgz and UPM Aug 18, 2021
@paulinon
Copy link
Contributor

Hi @jamier-hh,

In order to identify what's causing this behvaior, could you provide the debug logs for your iOS build after enabling debug logging?

@paulinon paulinon added the needs-info Need information for the developer label Aug 19, 2021
@jamier-hh
Copy link
Author

I've included both since for whatever reason, the repro-projects logs aren't as good. The game logs are edited to remove identifying information but nothing pertinent should have been removed.

@google-oss-bot google-oss-bot added needs-attention Need Googler's attention and removed needs-info Need information for the developer labels Aug 19, 2021
@paulinon
Copy link
Contributor

Thanks for the additional information, @jamier-hh. Could you also verify if you're getting a similar result when using our quickstart?

@paulinon paulinon added needs-info Need information for the developer and removed needs-attention Need Googler's attention labels Aug 20, 2021
@jamier-hh
Copy link
Author

Hmm very odd. It seems to be working with the quickstart.

@google-oss-bot google-oss-bot added needs-attention Need Googler's attention and removed needs-info Need information for the developer labels Aug 20, 2021
@jamier-hh
Copy link
Author
jamier-hh commented Aug 20, 2021

I figured it out. I wasn't explicitly referencing any of the actual Crashlytics features so the Crashlytics files weren't being included in the actual build. This is likely related to the fact that link.xml files are not honoured when they are included in packages: https://forum.unity.com/threads/the-current-state-of-link-xml-in-packages.995848/

@jamier-hh jamier-hh reopened this Aug 20, 2021
@paulinon
Copy link
Contributor

Hi @jamier-hh,

I noticed that your minimal repro has the Crashlytics initialization and testing all in one script. Could you try following along the setup in the documentation and see if this works out for you?

@paulinon paulinon added needs-info Need information for the developer and removed needs-attention Need Googler's attention labels Aug 20, 2021
@jamier-hh
Copy link
Author
jamier-hh commented Aug 20, 2021

It doesn't make a difference. Because the Crashlytics assembly is being included as a package, if you do not explicitly reference the assembly (by calling something like "Crashlytics.SetCustomKey"), Unity will strip it out. This is why there is a discrepancy between the minimal repo project and the quickstart project.

For most use cases, this wouldn't matter as most people will likely be explicitly referencing the Crashlytics assembly.

At this point, I'm not really sure this is an issue for the quickstart-unity package (I'm not sure it ever was to be honest haha)

@google-oss-bot google-oss-bot added needs-attention Need Googler's attention and removed needs-info Need information for the developer labels Aug 20, 2021
@DellaBitta
Copy link
Contributor

Hi @jamier-hh, this sounds like a Unity optimization that removes unused code, do you agree? If so I'm not sure what can be done on our end to fix this problem other than advise users to always reference something in Crashlytics so that it doesn't get dropped.

What do you think?

Thanks!

@DellaBitta DellaBitta added needs-info Need information for the developer and removed needs-attention Need Googler's attention labels Sep 1, 2021
@jamier-hh
Copy link
Author

Yeh, essentially. It isn't a problem if they are using the *.unitypackage version of Crashlytics as it will preserve the link.xml file. I would add it as a note for anyone who, like us, wants to use the *.tgz versions.

@google-oss-bot google-oss-bot added needs-attention Need Googler's attention and removed needs-info Need information for the developer labels Sep 1, 2021
@DellaBitta DellaBitta added type: bug and removed needs-attention Need Googler's attention labels Sep 4, 2021
@DellaBitta
Copy link
Contributor

I'm marking this as a bug to create a ticket for us to update our documentation. Thanks for the issue!

@DellaBitta
Copy link
Contributor

HI @jamier-hh,

I wasn't able to succesfully reproduce this with the versions that you specified. I followed the published instructions for importing the Unity Package Manager, Firebase Core/App and Firebase Crashlytics SDKs.

I've done all of this in the Crashlytics Quickstart project from this repo. Before building for Android I commented out all Crashlytics code invocations from the source. I then built the app into an .apk via Unity, and dragged and dropped the result into Android Studio where I was able to see the Crashlytics classes in the classes.dex file. There existence in the APK suggests that the classes aren't being stripped out.

I then launched the test app and used it to create uncaught exceptions. Upon restarting the app - which kicks off the Crashltyics upload process - I see the results in the Firebase Crashlytics project console.

Could you follow these steps and post here what your results are? Thank you!

@DellaBitta DellaBitta added needs-info Need information for the developer and removed type: bug labels Sep 10, 2021
@jamier-hh
Copy link
Author
jamier-hh commented Sep 10, 2021

The original issue was iOS only, which was probably lost in my assertation of what the issue actually was - sorry about that. If you try the same steps for iOS, and open the project in Xcode. Specifically the Firebase.App.Crashlytics*.cpp files will be missing from the Classes/Native folder.

I've attached a version of the test app that reproduces the issue. You just need to add the dependencies to the package folder:

  • com.google.external-dependency-manager-1.2.166.tgz
  • com.google.firebase.analytics-8.1.0.tgz
  • com.google.firebase.app-8.1.0.tgz
  • com.google.firebase.crashlytics-8.1.0.tgz

@google-oss-bot google-oss-bot added needs-attention Need Googler's attention and removed needs-info Need information for the developer labels Sep 10, 2021
@DellaBitta
Copy link
Contributor

Ok, thanks for the quickly follow up @jamier-hh. I was able to reproduce this behavior, and I'm sorry for the confusion about the Android target.

@DellaBitta DellaBitta added type: bug and removed needs-attention Need Googler's attention labels Sep 10, 2021
@chkuang-g
Copy link
Contributor
chkuang-g commented Sep 14, 2021

Interesting, looks like the prevention we put in Crashlytics no longer works.

Ex. this attribute, or the link.xml (This file is not found on firebase-unity-sdk. But probably just an unrelated issue.)

<linker>
<assembly fullname="Firebase.Crashlytics" ignoreIfMissing="1">
    <namespace fullname="Firebase.Crashlytics" preserve="all"/>
</assembly>
</linker>

It is pretty odd that this only affect .tgz but not .unitypackage.

@hegi25
Copy link
hegi25 commented Oct 29, 2021

Note that link.xml files are not supported inside packages, but you can reference package assemblies from non-package link.xml files.

You can put this link.xml file into your main Assets folder and the .tgz version will work.

@a-maurice
Copy link
Contributor

This will be fixed with the upcoming 10.1.0 Firebase Unity SDK, so closing the issue.

@firebase firebase locked and limited conversation to collaborators Nov 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants