jhomlala / catcher

Flutter error catching & handling plugin. Handles and reports exceptions in your app!
Apache License 2.0
784 stars 175 forks source link

[BUG] Screenshots path is empty. Sceenshots won't work #264

Open imerzi opened 9 months ago

imerzi commented 9 months ago

Describe the bug

I got a warning and the stack trace from Catcher that screenshot path is empty after initialize catcher in SilentReportMode and ConsoleHandler when my app is starting.

I don't want to have any screenshot saved is this possible to disable screenshots ?

it's not the same comportment in PageReportMode and ConsoleHandler, no page report and any stacktrace linked to the screenshot path is empty

Is this intended ?

To Reproduce

  // config used when Catcher detects that applications run in debug mode
  final CatcherOptions debugOptions = CatcherOptions(
    SilentReportMode(),
    <ReportHandler>[
      ConsoleHandler(),
    ],
  );

  // config used when Catcher detects that application runs in release mode
  final ReportMode reportMode = dotenv.get('APP_ENV') != 'prod' ? DialogReportMode() : SilentReportMode();
  final CatcherOptions releaseOptions = CatcherOptions(
    reportMode,
    <ReportHandler>[
      SentryHandler(
        SentryClient(SentryOptions(dsn: dotenv.get('SENTRY_DSN'))),
      ),
    ],
  );

  // [Catcher] include runApp to inflate the given widget
  Catcher(
    navigatorKey: GlobalKey<NavigatorState>(),
    rootWidget: LocalizedApp(
      delegate,
      const ProviderScope(
        child: MainApp(),
      ),
    ),
    debugConfig: debugOptions,
    releaseConfig: releaseOptions,
    ensureInitialized: true,
  );

Screenshots image

Flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.16.0, on Linux Mint 21.2 6.2.0-36-generic, locale fr_FR.UTF-8) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Chrome - develop for the web [✓] Linux toolchain - develop for Linux desktop [✓] Android Studio (version 2022.3) [✓] Connected device (3 available) [✓] Network resources

Catcher version

Smartphone (please complete the following information):

imerzi commented 9 months ago

bump

ThexXTURBOXx commented 9 months ago

This is fixed in catcher_2

imerzi commented 8 months ago

I will give it a try thanks

AnhTH260101 commented 2 months ago

This is fixed in catcher_2

I try using catcher 2 but it not working I/flutter (20975): [2024-06-12 16:37:53.889222 | Catcher | WARNING] Screenshots path is empty. Screenshots won't work. I/flutter (20975): [2024-06-12 16:37:53.899660 | Catcher | FINE] Catcher configured successfully. I/flutter (20975): [2024-06-12 16:37:54.133965 | Catcher | INFO] Setup localization lazily! I/flutter (20975): [2024-06-12 16:37:54.133965 | Catcher | INFO] Setup localization lazily! I/flutter (20975): null I/flutter (20975): null I/flutter (20975): [2024-06-12 16:37:54.169400 | Catcher | WARNING] Couldn't use report mode because you didn't provide navigator key. Add navigator key to use this report mode. I/flutter (20975): [2024-06-12 16:37:54.169400 | Catcher | WARNING] Couldn't use report mode because you didn't provide navigator key. Add navigator key to use this report mode.

ThexXTURBOXx commented 2 months ago

Couldn't use report mode because you didn't provide navigator key. Add navigator key to use this report mode.

@AnhTH260101

Edit: Also your issue is different. This issue (#264) is about a crash related to the screenshot manager (which is fixed in catcher_2). Your logs do not indicate any crash, just an invalid configuration. Read through the setup instructions again.

AnhTH260101 commented 2 months ago

Couldn't use report mode because you didn't provide navigator key. Add navigator key to use this report mode.

@AnhTH260101

Edit: Also your issue is different. This issue (#264) is about a crash related to the screenshot manager (which is fixed in catcher_2). Your logs do not indicate any crash, just an invalid configuration. Read through the setup instructions again.

i don't think the configuration is wrong because it was working 2. but when i using catcher_2 log show similar. I/flutter (26468): [2024-06-12 17:00:05.811426 | Catcher 2 | WARNING] Screenshots path is empty. Screenshots won't work. I/flutter (26468): [2024-06-12 17:00:05.853630 | Catcher 2 | FINE] Catcher 2 configured successfully. I/flutter (26468): [2024-06-12 17:00:06.075874 | Catcher 2 | INFO] Setup localization lazily! I/flutter (26468): [2024-06-12 17:00:06.075874 | Catcher 2 | INFO] Setup localization lazily! I/flutter (26468): [2024-06-12 17:00:06.120980 | Catcher 2 | WARNING] Couldn't use report mode because you didn't provide navigator key. Add navigator key to use this report mode. I/flutter (26468): [2024-06-12 17:00:06.120980 | Catcher 2 | WARNING] Couldn't use report mode because you didn't provide navigator key. Add navigator key to use this report mode.

ThexXTURBOXx commented 2 months ago

@AnhTH260101 Please open an issue using the proper template and provide code etc.: https://github.com/ThexXTURBOXx/catcher_2/issues/new?assignees=ThexXTURBOXx&labels=bug&projects=&template=bug_report.yaml&title=%5BBug%5D%3A+%3CChoose+an+appropriate+title%3E