Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.
This repository was archived by the owner on May 19, 2025. It is now read-only.

FirebaseScreenCaptureProcessor fails to create /sdcard/screenshots in API 29 devices due to scoped storage #7

@sushantchoudhary

Description

@sushantchoudhary

Sample error :

09-07 20:18:56.627: E/ScreenshotWatcher(25480): Failed to capture screenshot
09-07 20:18:56.627: E/ScreenshotWatcher(25480): java.io.IOException: The directory /sdcard/screenshots does not exist and could not be created or is not writable.
09-07 20:18:56.627: E/ScreenshotWatcher(25480): at androidx.test.runner.screenshot.BasicScreenCaptureProcessor.process(BasicScreenCaptureProcessor.java:72)
09-07 20:18:56.627: E/ScreenshotWatcher(25480): at androidx.test.runner.screenshot.ScreenCapture.process(ScreenCapture.java:144)
09-07 20:18:56.627: E/ScreenshotWatcher(25480): at com.atlassian.android.jira.core.testutil.rule.ScreenshotWatcher.captureScreenshot(ScreenshotWatcher.kt:29)
09-07 20:18:56.627: E/ScreenshotWatcher(25480): at com.atlassian.android.jira.core.testutil.rule.ScreenshotWatcher.failed(ScreenshotWatcher.kt:19)
09-07 20:18:56.627: E/ScreenshotWatcher(25480): at

Cause : https://developer.android.com/training/data-storage#scoped-storage

Temp fix : https://developer.android.com/training/data-storage/use-cases#opt-out-scoped-storage

Starting with Android 11, ^ workaround will stop working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions