I ran into a big problem trying to integrate the screenshot library from here into my very simple Android project. I carefully followed the steps described in the tutorial.
When I look at the logs from gcloud, I see the following error:
01-07 19: 41: 06.724: E / cloud_screenshotter (5752): Exception screenshot: java.io.FileNotFoundException: /sdcard/screenshots/com.computemachines.android.workplay.ClockingActivityScreenshotTest-takeScreenshot-main_screen_3-1.jpg opened : ENOENT (There is no such file or directory)
Oddly enough, I have another project on the same computer with an almost identical assembly structure, in which screenshots of work are taken! The gradle, test case, build.gradle version files are the same in both cases.
Excerpt from app / build.gradle in a repo that doesn't work
androidTestCompile (name:'cloudtestingscreenshotter_lib', ext:'aar') compile fileTree(dir: 'libs', include: ['*.jar']) // Espresso testing androidTestCompile 'com.android.support.test:runner:0.5' androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2' androidTestCompile 'com.android.support:support-annotations:25.1.0', { exclude group: 'com.google.code', module: 'jsr305' }
The full repo that doesn't work is on GitHub , and the repo work here .
The call command to call assemblies and run in GCloud is the same for both
./gradlew clean assembleDebug assembleDebugAndroidTest && gcloud beta test android run \ --type instrumentation \ --app app/build/outputs/apk/app-debug-unaligned.apk \ --test app/build/outputs/apk/*est-unaligned.apk \ --device-ids Nexus6 \ --os-version-ids 23 \ --locales en \ --orientations portrait
I spent more than 10 hours trying to figure it out, and a summary map of the mind of all the things I tried is here . I can provide any other information that is necessary, but I wanted to solve this problem.
android firebase android-espresso gcloud
satyajit
source share