Closed sushantchoudhary closed 3 years ago
@sushantchoudhary how do you specify the no-isolated-storage
option to run the tests? Either in Android Studio and with CI?
I've added the argument in the run configuration, but it keeps throwing the exception The directory /sdcard/screenshots does not exist and could not be created or is not writable.
Starting with Android 11, ^ workaround will stop working.
Hi @sushantchoudhary @eduardbosch
What does this mean exactly? I am getting this error in Android 11. How can we get screenshots displayed in Firebase Test Lab reports in Android 11?
Thanks
I was able to grant my test runner access to the /sdcard/screenshots
directory in Android 11 by using the ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
intent. See https://stackoverflow.com/a/66968986.
I then used UiAutomator to grant the permission in the settings activity that appears.
The workaround is not working for me..
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.