-
Notifications
You must be signed in to change notification settings - Fork 46
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
Crash reports are ignored without error if Fabric is not initialized #69
Comments
Hi @apaatsio, we can't return an error, the reason we return a success is because if you ask permission to retrieve data to your user (as you must do in Europe because of the law) user can say no so you'll not call What I don't understand is how can you have a crash before initializing fabric ? that's the first thing you should do and |
I'm using await. I believe I added logging like this: if (methodCall.method.equals("initialize")) {
Fabric.with(context, new Crashlytics(), new CrashlyticsNdk());
Log.d("FlutterCrashlytics", "Fabric.isInitialized:" + Fabric.isInitialized());
result.success(null);
} and it prints |
Shit, dawn Fabric ^^ |
@jaumard I have experienced this only on Android since I don't have an Apple device to test on. |
From the doc:
so problem is only on Android as iOS API doesn't have this So maybe the fix is just not to use this method and have a boolean into the class instead. |
Problem
I managed to produce a situation where I had a crash very soon after the launch of the app when Fabric wasn't fully initialized yet. In such case, a call to
FlutterCrashlytics().reportCrash()
returns successfully even though it doesn't actually report the crash.The problem is the
else
branch here:flutter_crashlytics/android/src/main/java/com/kiwi/fluttercrashlytics/FlutterCrashlyticsPlugin.java
Lines 36 to 40 in e14aa46
As can be seen, it always returns succesully, even when Fabric is not initialized.
Possible solution
Instead of calling
result.success(null)
, do something like this so that the caller can retry later if they want to:The text was updated successfully, but these errors were encountered: