Skip to main content

Black screenshots in Flutter • Blank bug reports • Double-tap recording fix

Fix black screenshots and screen recording behavior in Flutter apps on Android.

Written by Peter Simic
Updated this week

If your Flutter bug reports contain black screenshots or the recording button requires a double-tap to start, follow these steps:

  • Update the SDK: Ensure you are using shake_flutter v17.2.2 or higher. This version is specifically optimized to handle the new rendering and security hooks required by Android 15 and 16.

  • Initialization: In your main.dart, ensure Shake.start() is called after WidgetsFlutterBinding.ensureInitialized(). If it is called too early, the screenshot engine cannot properly bind to the Flutter surface.

  • Check FLAG_SECURE: If your screenshots are black, check your MainActivity.kt. If WindowManager.LayoutParams.FLAG_SECURE is set, Android force-blacks all screenshots for security.

  • The "Double-Tap" Flow: On Android 16, the first tap triggers a system-level security prompt ("Start recording or casting?"). The second tap starts the Shake recording. This is a system security requirement for user privacy on newer OS versions.

  • Repaint Boundary: If screens are still black, wrap your root widget (usually MaterialApp) in a RepaintBoundary. This ensures the Flutter engine provides a valid pixel buffer to the Shake SDK.

Note: Screenshots are not supported on legacy devices running Android 6.0 or below. The minimum requirement for Flutter screen capture is Android 7.0.

Did this answer your question?