Skip to content
This repository was archived by the owner on Jan 7, 2026. It is now read-only.

test failure: Is your sdcard directory read-only?  #323

@HussainChachuliya0306

Description

@HussainChachuliya0306

Dependencies used:

screenshot : 0.15.0
kotlin: 1.7.10
gradle: 7.5

I'm getting below error while trying to run a test:

java.lang.RuntimeException: Failed to create the directory /sdcard/screenshots/com.slopes.test/screenshots-default for screenshots. Is your sdcard directory read-only?
	at com.facebook.testing.screenshot.internal.ScreenshotDirectories.getSdcardDir(ScreenshotDirectories.java:126)

Here is my failing test:


   @Test
    fun screenshotTest() {
      mockData()

        val scenario = openFragment(r)
        scenario.onFragment {
            Screenshot.snapActivity(it.requireActivity())
                .setName("sampleTest1")
                .record()
        }

        PageObject.on<FragPageObject>()
            .verifyEmptyView()
    }

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