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

[Question] Unity desktop with Crashlytics Analytics #1219

Open
mmiro1 opened this issue Jan 13, 2022 · 12 comments
Open

[Question] Unity desktop with Crashlytics Analytics #1219

mmiro1 opened this issue Jan 13, 2022 · 12 comments

Comments

@mmiro1
Copy link

mmiro1 commented Jan 13, 2022

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2020.3.24f1
  • Firebase Unity SDK version: 8.7.0
  • Source you installed the SDK: .unitypackage
  • Problematic Firebase Component: Crashlytics
  • Other Firebase Components in use: Analytics
  • Additional SDKs you are using: non
  • Platform you are using the Unity editor on: Windows
  • Platform you are targeting: desktop
  • Scripting Runtime: Mono and IL2CPP

[REQUIRED] Please describe the question here:

Hi, I am trying to use Analytics and Crashlytics in my projects and I am having some problems with it. I just created a new project to make some testing and I get the same results, I don't see anything from the Firebase console. All the code I am using is the following one:

using Firebase;
using Firebase.Analytics;
using Firebase.Crashlytics;
using Firebase.Extensions;
using UnityEngine;
using UnityEngine.UI;

public class FirebaseManager : MonoBehaviour
{
    GameObject nullGameObject;
    FirebaseApp app;
    public Text text;

    void Start()
    {
        FirebaseApp.LogLevel = LogLevel.Debug;

        FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task =>
        {
            var dependencyStatus = task.Result;
            if (dependencyStatus == DependencyStatus.Available)
            {
                // Create and hold a reference to your FirebaseApp,
                // where app is a Firebase.FirebaseApp property of your application class.
                // Crashlytics will use the DefaultInstance, as well;
                // this ensures that Crashlytics is initialized.
                app = FirebaseApp.DefaultInstance;

                // Set a flag here for indicating that your project is ready to use Firebase.
                //x = true;

                FirebaseAnalytics.SetAnalyticsCollectionEnabled(true);
                FirebaseAnalytics.LogEvent(FirebaseAnalytics.EventAppOpen);

                Debug.Log("Ready!");
                text.text = "Ready!";
            }
            else
            {
                Debug.LogError($"Could not resolve all Firebase dependencies: {dependencyStatus}");
                // Firebase Unity SDK is not safe to use here.
            }
        });
    }

    // Methods called by UI buttons

    public void Crash()
    {
        Debug.Log("Crash!");
        text.text = "Crash!";

        Crashlytics.LogException(new System.Exception("test"));
        throw new System.Exception("test exception please ignore");
    }

    public void NullCrash()
    {
        Debug.Log("Crash null!");
        text.text = "Crash null!";

        nullGameObject.transform.position = Vector3.zero;
    }

    public void Log()
    {
        Debug.Log("Log!");
        text.text = "Log!";

        FirebaseAnalytics.LogEvent(FirebaseAnalytics.EventLogin);

        FirebaseAnalytics.LogEvent(
            FirebaseAnalytics.EventLogin,
            new Parameter[] {
                new Parameter(FirebaseAnalytics.ParameterMethod, "hello"),
            }
        );
    }

}

As I undestand, with this code and enabling the Analytics and Crashlytics in the firebase project is enough to have it working. After that you only need to add the unity project to firebase as an android app and download the "google-services.json" install the unity packages of Analytics and Crashlytics.

But in the console I get this output:

image

I supouse that the problem reside in that the app initializer crashlytics is not found, but i don't undestand why.

Am I missing any step or making something wrong? Do I have to make any extra step to have it working in desktop?
Also, can I test while running from the Unity editor without makeing a build?

Thank you in advance.

@mmiro1 mmiro1 changed the title [Question] [Question] Unity desktop with Crashlytics Analytics Jan 14, 2022
@paulinon paulinon removed the new New issue. label Jan 17, 2022
@paulinon
Copy link
Contributor

Hi @mmiro1,

Thanks for reporting this. It appears that neither Crashlytics nor Analytics are supported for desktop according to our documentation.

That being said, are these features that you want implemented in the future?

@paulinon paulinon added the needs-info Need information for the developer label Jan 17, 2022
@mmiro1
Copy link
Author

mmiro1 commented Jan 18, 2022

Hi @paulinon ,

Thanks for your answer. I didn't realize these products weren't supported for desktop. Regarding your question, it would be great to see them in the future. Is there any date or estimation for when it could be included?

Thank you again and sorry for the inconvenience.

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

Hi @mmiro1,

I'm unable to provide a timeline for this. However, you may check this thread for updates. I'll be marking this as a feature request for now.

@waleed347
Copy link

Is there any update on this?

@ynj97
Copy link

ynj97 commented Mar 27, 2023

1 on having this feature. Currently have to use UGS, and would much rather have everything on firebase

@ynj97
Copy link

ynj97 commented Apr 24, 2023

Hi Paulinon,

Want to follow up to see if there is any updates on this feature. Would be very helpful.

Thanks

@fanhaining
Copy link

Any Plan?

@staneta
Copy link

staneta commented Sep 27, 2023

1

@markusmalmros
Copy link

I would find this really useful as well.

@AldeRoberge
Copy link

There is a serious lack of great analytics solutions for Unity standalone. UGS is expensive. Firebase Analytics seems like a no brainer, yet it does not support unity standalone builds or the editor.

@kael558
Copy link

kael558 commented Apr 19, 2024

Has there been any updates on this? Having analytics on the desktop app would be really useful...

@mingxxming
Copy link

1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests