quickstart-unity: Crashlytics not sending any crash reports, getting "failed to retrieve settings" error on logcat.
[REQUIRED] Please fill in the following fields:
- Unity editor version: 2019.3.15f1
- Firebase Unity SDK version: firebase_unity_sdk_6.15.2
- Source you installed the SDK: .unitypackage
- Problematic Firebase Component: Crashlytics
- Other Firebase Components in use: Analytics
- Additional SDKs you are using: Unity IAP, Gamesparks, Ironsource, Facebook, Appsflyer, GameAnalytics
- Platform you are using the Unity editor on: Windows
- Platform you are targeting: Android
- Scripting Runtime: IL2CPP
[REQUIRED] Please describe the issue here:
I am getting some data on analytics, but I cannot get crashlytics to report anything. Im stuck on this…
Steps to reproduce:
Add the firebase analytics and crashlytics sdks. Add the google-services.json GoogleService-Info.plist files somewhere in assets folder Add this code to initialise the firebase
`// Use this for initialization void Start () { // Initialize Firebase Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => { var dependencyStatus = task.Result; if (dependencyStatus == Firebase.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. Firebase.FirebaseApp app = Firebase.FirebaseApp.DefaultInstance;
// Set a flag here for indicating that your project is ready to use Firebase.
VisualDebugger.SetText("crashlytics initialised");
}
else
{
UnityEngine.Debug.LogError(System.String.Format(
"Could not resolve all Firebase dependencies: {0}",dependencyStatus));
VisualDebugger.SetText("crashlytics NOT initialised: " + dependencyStatus);
// Firebase Unity SDK is not safe to use here.
}
});
Invoke("IsCrashEnabled", 5f);
}
void IsCrashEnabled()
{
VisualDebugger.AddLine("IsCrashlyticsCollectionEnabled: "+Firebase.Crashlytics.Crashlytics.IsCrashlyticsCollectionEnabled);
}`
When I run the app, firebase is initialised successfully. Also Firebase.Crashlytics.Crashlytics.IsCrashlyticsCollectionEnabled returns true.
I crash the app in a number of different ways, then open it again without reinstalling. But no crash reports are sent.
When I watch logcat when starting the app I see this error from firebase each time the app is opened
Relevant Code:
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 45 (6 by maintainers)
@ZaheerFaisal I’ve added at Start method of my Firebase Manager script, before the Firebase init code, make sure to also add “Firebase.FirebaseApp.LogLevel = Firebase.LogLevel.Debug;” to show debug messages.
I’ve added “Crashlytics.IsCrashlyticsCollectionEnabled = true;” to get it working… maybe we just need to add something related to Crashlytics on the project to Unity add the dependencies.
Hi folks, there may be a few different issues going on at once here. We recently discovered a backend issue that was preventing some new Android Unity apps from being properly registered with Crashlytics. That was fixed on Friday, so if you were still having trouble last week, please give it another attempt and let us know if you are still having trouble.
The next release of the Crashlytics Unity Plugin will include a fix for the NoSuchMethodException, and will ship with the newest Crashlytics for Android SDK. Until that release, manually updating to version 17.2.x of the Android will not work, as @nchodelski described.
@cynthiajoan, I’m experiencing this as well:
my setup:
One thing to note is my org has 2 Firebase projects setup - I am only experiencing this issue when working with Crashlytics for android in 1 of 2 Firebase projects from my organization.
So building from the same Unity project:
The above makes this makes me think the issue is not related to the Unity version. I suspect it must be related specifically to the contents of the ‘firebase settings’ json the Android app unable to retrieve.
I have already tried deleting and re-creating the Android app that is not working_ from the Firebase project, as suggested previously, twice. Both times, the ‘new’ android Firebase app configuration still resulted in the same ‘cannot retrieve settings’ error as before when run (confirmed i was seeing different appId values in the URL to ensure the config values did get passed in when resolving dependencies)
other details of setup:
Other potentially useful details i noticed while investigating: I noticed when I called the settings URL from the error but swapped in the Firebase ID for the Firebase app w/ a ‘working’ Crashlytics setup, I got this response:
{"settings_version":3,"cache_duration":86400,"features":{"collect_logged_exceptions":true,"collect_reports":true,"collect_analytics":false,"prompt_enabled":false,"push_enabled":false,"firebase_crashlytics_enabled":false},"app":{"status":"activated","update_required":false,"report_upload_variant":2},"fabric":{"org_id":"xyzyx","bundle_id":"com.MyCompany.xyz"}}
Meanwhile the settings link for the Firebase app where Android Crashlytics is broken returns only an empty dictionary:
{}
My theory is that the fact there are no settings at that endpoint is the reason why Crashlytics events are not being sent (my theory is because the app believes Crashlytics is not enabled if there are no settings available)@nchodelski Thanks, your info helped. I did have to clear out the older version of Crashlytics completely and clean install from the 6.16.0 unity package. However, I still found my self without any crash reports. 6.16.0 Unity Package Doesn’t work with Unity 2018.4.6f1. The app would build and Chrashlytics 17.1.1 would initialize but crashes would not be reported. I had to update my unity editor to the latest of 2018.4 LTS.
@Splitkill - I had the same issue as you did after setting my Unity project to use a custom
mainTemplate.gradle
file, then manually setting theCrashlytics-Dependencies.xml
to say"com.google.firebase:firebase-crashlytics:17.2.2"
(btw, my Crashlytics Dependencies file was not in Assets, I had to search by file for it. I found it at:
my_project_root/Library/PackageCache/com.google.firebase.crashlytics@6.16.0/Firebase/Editor/Crashlytics-Dependencies.xml
.I found this other unity-quckstart issue where it was explained why you and I are seeing this error about the DataCollectionArbiter class when using 17.2.2 with Unity:
I was able to resolve the
Unable to find Method
error by instead specifying “com.google.firebase:firebase-crashlytics:17.1.1” in theCrashlytics-Dependencies.xml
file. Finally, I no longer see the settings error and I see from the logs the android app initializes version 17.1.1.Hi @Brian-McElroy, good to know this is a project directly created in Crashlytics, that makes things easy and you don’t have to share the configuration files. The “Fail to retrieve settings” error usually happens once an app is deleted, and not restored properly. If you can take some time double check with this doc to see if there is any step missing.
If everything looks correct to you but you are still suffering with the issue, it worth to submit a ticket here so our support team can get access to your project and see if anything not look correct.