I tried fabric.io dashboard (an app with the Androidmanifest and such where crashes are reported) and I tried a firebase crashlytics bug
I tried keys regular places and, just in case, right before sent, string, boolean, int, etc
void main() {
Crashlytics.instance.enableInDevMode = true;
Crashlytics.instance.setUserIdentifier("pretend guid");
// Pass all uncaught errors to Crashlytics.
FlutterError.onError = (FlutterErrorDetails details) {
Crashlytics.instance.setString("Key_within_on_error", "test535");
Crashlytics.instance.onError(details);
};
runApp(MyApp());
}
Important note: Crashlytics.instance.log(message) does work and the logs do show up, and userid does work.
@neiljaywarner
The issue at https://github.com/flutter/flutter/issues/31371 has been closed and moved here. Future collaboration on this issue will be done here.
Based on https://github.com/flutter/flutter/issues/31371#issuecomment-538624962 I think it's safe to close the issue. If the issue still exists, please comment and I will re-open it right away.
It is still a problem for me. I have this basic code that works as expected on android, but partially on ios.
On ios, crashes are reported without keys.
I am using the latest firebase_crashlytics version.
Crashlytics.instance.enableInDevMode = true;
Crashlytics.instance.setBool('testBool', true);
Crashlytics.instance.setInt('testInt', 42);
Crashlytics.instance.setString('testString', 'foobar');
Crashlytics.instance.setDouble('testDouble', 42.123);
try {
throw new Exception("Just a test!");
} catch (e, stacktrace) {
print('logging crash to Crashlytics');
Crashlytics.instance.recordError(e, stacktrace);
}
@BondarenkoStas @kroikie I also have a problem with keys on IOS (works fine on Android). The report appears in Crashlytics without keys. I'm using 0.1.2+2 version.
Future<void> main() async {
Crashlytics.instance.enableInDevMode = true;
FlutterError.onError = (FlutterErrorDetails details) {
Crashlytics.instance.setString("clientId", "111111");
Crashlytics.instance.onError(details);
};
runZoned<Future<void>>(() async {
runApp(MyApp());
}, onError: Crashlytics.instance.recordError);
}
(Re-)Apologize on my side, it appears that it is finally still not working fine on iOS and I was wrong in my last comment https://github.com/flutter/flutter/issues/31371#issuecomment-538624962.
So, to apologize, I've just corrected the bug and sent a PR (https://github.com/FirebaseExtended/flutterfire/pull/1782/)
You can already use it in your project by replacing in the file pubspec.yaml:
firebase_crashlytics: ^0.1.2+4
with
firebase_crashlytics:
git:
url: git://github.com/sperochon/flutterfire.git
ref: firebase_crashlytics-sperochon-patch-ios-keys-1
path: packages/firebase_crashlytics
I still have the same problem on firebase_crashlytics: ^0.1.2+5. Why is it not getting fixed? I have already reported this a couple of times and everytime someone says it's fixed. Do we even know why prevents it from working?
EDIT: Ah, I see. The PR is not merged yet! :( It's been a month and it seems like a merge conflict needs to be taken care of.
@sperochon @collinjackson @kroikie
@behnamsattar The merge conflict is not the problem (not yet ;-)) since there was no conflict when I submit this PR. Even if I correct it, there will be a new conflict every new release... until a reviewer has some time to look at it.
Then I guess I need to bug @collinjackson and @kroikie :)
This issue should be reopened as this problem still exists!
Any update on this? Are you planning to take care of it anytime soon?
this root cause shall be at https://github.com/FirebaseExtended/flutterfire/blob/master/packages/firebase_crashlytics/darwin/Classes/FirebaseCrashlyticsPlugin.m#L56.
you will see the given value of setValue call is from call.arguments, which is wrong.
to whom having this issue, you can simply fork this repo and change the code as workaround to
if ([@"int" isEqualToString:key[@"type"]]) {
[[Crashlytics sharedInstance] setIntValue:(int)key[@"value"]
forKey:key[@"key"]];
} else if ([@"double" isEqualToString:key[@"type"]]) {
[[Crashlytics sharedInstance] setFloatValue:[key[@"value"] floatValue]
forKey:key[@"key"]];
} else if ([@"string" isEqualToString:key[@"type"]]) {
[[Crashlytics sharedInstance] setObjectValue:key[@"value"]
forKey:key[@"key"]];
} else if ([@"boolean" isEqualToString:key[@"type"]]) {
[[Crashlytics sharedInstance] setBoolValue:[key[@"value"] boolValue]
forKey:key[@"key"]];
}
For me too setUserName doesn't seems to work, the username doesn't appears on the CrashLytics UI.
await Crashlytics.instance.setUserName(username);
EDIT : it works now, I need to inverstigate
I still don't understand why this PR is not getting reviewed and merged. This issue has been identified for more than a year (was on flutter repo before) and the fix was introduced in a PR about 5 months ago!
@behnam-lum
FlutterFire is currently getting a rework as per the roadmap
We're working through Crashlytics at the moment, where a number of these issues (including this one) have been resolved. Keep an eye out on the roadmap for a release
A new Crashlytics plugin has now landed on master which should solve this issue.
Checkout the migration guide to get started on upgrading to the new Crashlytics plugin: https://firebase.flutter.dev/docs/migration/
Most helpful comment
@behnam-lum
FlutterFire is currently getting a rework as per the roadmap
We're working through Crashlytics at the moment, where a number of these issues (including this one) have been resolved. Keep an eye out on the roadmap for a release