_Platform:_
_IDE:_
_split-debug-info and obfuscate (Flutter Android or iOS) or CanvasKit (Flutter Web):_
_Platform installed with:_
Output of the command flutter doctor -v below:
[✓] Flutter (Channel stable, 2.0.3, on Mac OS X 10.13.6 17G14042 darwin-x64, locale en-DK)
• Flutter version 2.0.3 at /Users/larsstoettrup/workspace/flutter
• Framework revision 4d7946a68d (12 days ago), 2021-03-18 17:24:33 -0700
• Engine revision 3459eb2436
• Dart version 2.12.2
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/larsstoettrup/Library/Android/sdk
• Platform android-30, build-tools 30.0.2
• ANDROID_HOME = /Users/larsstoettrup/Library/Android/sdk
• 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-6915495)
• All Android licenses accepted.
[!] Xcode - develop for iOS and macOS
✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
Download at: https://developer.apple.com/xcode/download/
Or install Xcode via the App Store.
Once installed, run:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
! CocoaPods 1.9.1 out of date (1.10.0 is recommended).
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] VS Code (version 1.54.3)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.20.0
[✓] Connected device (2 available)
• SM T510 (mobile) • R52N70RYCGL • android-arm • Android 10 (API 29)
• Chrome (web) • chrome • web-javascript • Google Chrome 89.0.4389.90
! Doctor found issues in 1 category.
The version of the SDK (See pubspec.lock):
4.1.0-nullsafety.1
I have the following issue:
I keep getting the error in the title upon boot in Android (real physical device). The weird thing is that it happens in debug mode, so I don't expect proguard to be involved.
Steps to reproduce:
Well for me, the following code breaks:
import 'package:sentry_flutter/sentry_flutter.dart' as sen;
void main() async {
runZonedGuarded<Future<void>>(() async {
await sen.SentryFlutter.init((options) => options.dsn = 'https://<hidden away>@sentry.io/<hidden away>');
runApp(OurWidget());
}, (error, StackTrace stackTrace) async {
await SentryErrorReporter().reportError(error, stackTrace);
});
}
Actual result:
Expected result:
@larssn your init block is wrong, please visit https://docs.sentry.io/platforms/flutter/#configure
let us know if that does not help and we'll reopen it, thanks.
@larssn your init block is wrong, please visit https://docs.sentry.io/platforms/flutter/#configure
let us know if that does not help and we'll reopen it, thanks.
Dude, this is on the front page of the pub page: https://pub.dev/packages/sentry_flutter
import 'dart:async';
import 'package:flutter/widgets.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
Future<void> main() async {
runZonedGuarded(() async {
await SentryFlutter.init(
(options) {
options.dsn = 'https://[email protected]/add-your-dsn-here';
},
);
runApp(MyApp());
}, (exception, stackTrace) async {
await Sentry.captureException(exception, stackTrace: stackTrace);
});
}
So if that is wrong, you need to update your docs.
(It's been running for a year and a half like that, for us)
@larssn I'll check that, thanks.
sentry_flutter isn't 1y and half old, so the init. method has changed just a few months ago.
is there a reason why you need a custom runZonedGuarded?
@marandaneto We used to use the normal sentry plugin. We only just switched to sentry_flutter.
Yeah, we need it because we don't want errors happening in debug mode to trickle to sentry. So unless that's something the other initialization method supports, we gotta keep it.
As you can see in the op, uncaught errors are fed to a custom class, that tries to fill out some additional info before sending to sentry. I can post its code, but I don't think it's relevant, as the crash happens long before that.
EDIT
I should add that we basically only want uncaught errors to trickle to sentry. So we rarely use the manual approach of calling .reportError().
@larssn I just tried out and it worked as expected.
no crashes and the App. opened normally, using a custom runZonedGuarded or not, tried both, also using Flutter 2.0.3 on Android.
can you create a sample repro?
btw another way of looking into this (filtering events) is thru the beforeSend callback, See https://docs.sentry.io/platforms/flutter/configuration/filtering/
So we've seem to have reproduced it:
Adding another local dependency like below (to pubspec), causes the problem:
our_local_library:
path: '../path_to_lib'
Everything compiles, there are no warnings or any apparent problems, but when flutter want to start, the above crash happens. Very weird. Not sure there's much you can do about it, so I'll close this.
For future curious people, this issue was causing the problem: https://github.com/flutter/flutter/issues/75416