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_flutterv17.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, ensureShake.start()is called afterWidgetsFlutterBinding.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. IfWindowManager.LayoutParams.FLAG_SECUREis 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 aRepaintBoundary. 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.