-
Notifications
You must be signed in to change notification settings - Fork 4k
firebase_crashlytics: Crashlytics does not show Flutter origin of NDK crashes on Android #17014
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
Comments
Hi @shahbazhashmi - Flutter stack traces are different. They require using the debug symbols when you build your Flutter app. So if you build your app like so:
You can grab the obfuscated stack trace from Firebase Crashlytics console, save it in
You should see a readable stack trace. |
Hello @russellwheatley thanks for reply. I don't use obfuscation and I build app using |
You have to remember that a crash occurring on the android side isn't going to register the dart code leading up to it as it is a separate process. Presuming you're using something like a method channel to communicate Flutter <--> Android; You would have to catch the exception on the native side which can be passed back to Flutter as a failed future, then you would have to use recordError() in the Flutter side for it to be reported to Crashlytics. If it is an uncaught exception on the android side, it will only show the android stack trace. |
@russellwheatley I don't think the crash is occurring on the native Android side since the SDK provides Flutter methods, and the crash happens when calling those methods. It's a fatal crash that kills the app, so I don’t think it can be caught using a try-catch block. However, we are already using runZonedGuarded for error handling, and we are invoking the Crashlytics method in the necessary places. |
I have checked this as well and it gives same symbolicated logs. Please read the issue again. |
I'm a bit confused at this point. Could you provide a stack trace of the crash? |
Here are the stack trace (2/209 threads) of the crash Thread #1
Thread #2
Here you can see there is no information of Flutter origin of the crash. Also there is no information for "libc.so" and "libflutter.so". |
Those stack traces are not coming from your Flutter source code. |
@russellwheatley So, what's the solution? How can I get the Flutter stack trace? Are libc.so and libflutter.so supposed to appear like this? |
Those stack traces are from the Flutter framework internal implementation I believe, which I think is written in C++ roughly speaking. I'm not sure how you triggered them as this is the first time I've seen them. this |
That's the thing, Suppose this is my Flutter code where I am invoking the SDK method from the Flutter side:
What I need:
|
You don't obfuscate your app code so I don't think it needs de-obfuscating. I have no idea how to get symbolicated stack trace of |
I don't understand how it is related to Flutter. I can open an issue on Flutter repo but I am not sure if they will address it. What about the Flutter origin of the crash ? |
I'm not sure how to capture correct stack trace from Edit, I had a quick google and found an open issue for the very thing you're after: I'm closing this issue out as it isn't fixable from this repo. |
Is there an existing issue for this?
Which plugins are affected?
Crashlytics
Which platforms are affected?
Android
Description
My Flutter Android app uses a third-party SDK that provides its own symbol files. Recently, we integrated the Crashlytics plugin and made the necessary changes on the Android native side.
The integration works perfectly for Flutter crashes, and even Android native crashes are being reported correctly. For SDK-related crashes, we upload the symbol files (provided by the SDK) using the CLI. These symbol files allow us to view symbolicated crash logs for the uploaded symbols. However, the Crashlytics console does not display the Flutter origin of these crashes. So how can I get Flutter origin of such crashes ?
Additionally, I see several entries on the console like the following:
libc.so (Missing BuildId xxxxx)
libflutter.so (Missing BuildId xxxxx)
How can I symbolicate these?
For context, I have not done any advanced configurations for Crashlytics on the Android native side. I have only added the required dependencies and plugins in the Gradle files.
Reproducing the issue
app build.gradle
settings.gradle
Firebase Core version
3.8.1
Flutter Version
3.24.5
Flutter dependencies
Expand
Flutter dependencies
snippetThe text was updated successfully, but these errors were encountered: