- Unity editor version: 2020.3.20f1
- Firebase Unity SDK version: firebase_unity_sdk_8.6.2
- Additional SDKs: Admob SDK
- Platform Unity editor on Windows
- Platform targeting: Android
- Scripting Runtime: IL2CPP
- API Compability Level: .NET 4.x
Issue
Crashlytics is stuck like this, but the analytics is getting data.
I'm already installed Crashlytics SDK
on my project and added configurations like on the document but skip part 4: that symbol thing.
( https://firebase.google.com/docs/crashlytics/get-started?platform=unity ) to my script
so my script becomes like this:
public static FirebaseManager Instance;
private FirebaseApp app;
private void Awake()
{
Instance = this;
}
private void Start()
{
InitFB();
}
private void InitFB()
{
// Initialize Firebase
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;
FirebaseApp.LogLevel = LogLevel.Debug;
Debug.Log(dependencyStatus);
// Set a flag here for indicating that your project is ready to use Firebase.
}
else
{
Debug.LogError(System.String.Format(
"Could not resolve all Firebase dependencies: {0}", dependencyStatus));
// Firebase Unity SDK is not safe to use here.
}
});
}
then implement for tests like the doc ( https://firebase.google.com/docs/crashlytics/test-implementation?platform=unity )
Test script
int updatesBeforeException;
// Start is called before the first frame update
void Start()
{
updatesBeforeException = 0;
}
private void Update()
{
// Call the exception-throwing method here so that it's run
// every frame update
throwExceptionEvery60Updates();
}
// A method that tests your Crashlytics implementation by throwing an
// exception every 60 frame updates. You should see non-fatal errors in the
// Firebase console a few minutes after running your app with this method.
void throwExceptionEvery60Updates()
{
if (updatesBeforeException > 0)
{
updatesBeforeException--;
}
else
{
// Set the counter to 60 updates
updatesBeforeException = 60;
// Throw an exception to test your Crashlytics implementation
throw new System.Exception("test exception please ignore");
}
}
When I run the app on the editor, initialize return available then I test crash it work
am I doing wrong here?