-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Description
Bug report
Crashlytics records errors installed from the play store or via flutter build apk --release; flutter install
as .java errors, with java stack traces.
Errors recorded from apps installed to a device via flutter run --release
are shown using .dart file extensions and dart stack traces.
Steps to reproduce
Set up the example app, ensure it calls recordError
and records to crashlytics. Run it via the following methods:
flutter clean; flutter build apk --release; flutter install
flutter clean; flutter run --release;
Expected behavior
Crashlytics should show 2 instances of the same error occurring in the dashboard.
Additional context
This is what I have seen after setting up a simple app to induce an error. Running the app via flutter install
creates a .java
error, and via flutter run
creates a .dart
error. The error records in the screenshot are from the same source in-app
I added this code to the example flutter app and created a MaterialButton to call it:
void _initializeAppAndCrash() async {
await Firebase.initializeApp();
await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true);
FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError;
FirebaseCrashlytics.instance.recordError('oops!', StackTrace.current);
}
Flutter doctor
Run flutter doctor
and paste the output below:
Click To Expand
[✓] Flutter (Channel stable, 1.22.2, on Mac OS X 10.15.7 19H2, locale en-US)
• Flutter version 1.22.2 at /Users/nathan/Repositories/flutter
• Framework revision 84f3d28555 (2 weeks ago), 2020-10-15 16:26:19 -0700
• Engine revision b8752bbfff
• Dart version 2.10.2
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/nathan/Library/Android/sdk
• Platform android-30, build-tools 29.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.1, Build version 12A7403
• CocoaPods version 1.9.3
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 50.0.2
• Dart plugin version 201.9002
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] VS Code (version 1.50.1)
• VS Code at /Users/nathan/Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.15.1
[✓] Connected device (1 available)
• SAMSUNG SM G930A (mobile) • fdeeff55 • android-arm64 • Android 8.0.0 (API 26)
• No issues found!
Flutter dependencies
Run flutter pub deps -- --style=compact
and paste the output below:
Click To Expand
Dart SDK 2.10.2
Flutter SDK 1.22.2
crashlytics_test 1.0.0+1
dependencies:
- cupertino_icons 1.0.0
- firebase_core 0.5.1 [firebase_core_platform_interface flutter quiver meta firebase_core_web]
- firebase_crashlytics 0.2.2 [flutter stack_trace firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface]
- flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine]
dev dependencies:
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher meta source_span stream_channel string_scanner term_glyph typed_data]
transitive dependencies:
- async 2.5.0-nullsafety.1 [collection]
- boolean_selector 2.1.0-nullsafety.1 [source_span string_scanner]
- characters 1.1.0-nullsafety.3
- charcode 1.2.0-nullsafety.1
- clock 1.1.0-nullsafety.1
- collection 1.15.0-nullsafety.3
- fake_async 1.2.0-nullsafety.1 [clock collection]
- firebase 7.3.2 [http http_parser js]
- firebase_core_platform_interface 2.0.0 [flutter meta plugin_platform_interface quiver]
- firebase_core_web 0.2.0 [firebase firebase_core_platform_interface flutter flutter_web_plugins meta js]
- firebase_crashlytics_platform_interface 1.1.2 [flutter meta collection firebase_core plugin_platform_interface]
- flutter_web_plugins 0.0.0 [flutter characters collection meta typed_data vector_math]
- http 0.12.2 [http_parser path pedantic]
- http_parser 3.1.4 [charcode collection source_span string_scanner typed_data]
- js 0.6.2
- matcher 0.12.10-nullsafety.1 [stack_trace]
- meta 1.3.0-nullsafety.3
- path 1.8.0-nullsafety.1
- pedantic 1.9.2 [meta]
- plugin_platform_interface 1.0.3 [meta]
- quiver 2.1.4+1 [matcher meta]
- sky_engine 0.0.99
- source_span 1.8.0-nullsafety.2 [charcode collection path term_glyph]
- stack_trace 1.10.0-nullsafety.1 [path]
- stream_channel 2.1.0-nullsafety.1 [async]
- string_scanner 1.1.0-nullsafety.1 [charcode source_span]
- term_glyph 1.2.0-nullsafety.1
- test_api 0.2.19-nullsafety.2 [async boolean_selector collection meta path source_span stack_trace stream_channel string_scanner term_glyph matcher]
- typed_data 1.3.0-nullsafety.3 [collection]
- vector_math 2.1.0-nullsafety.3