Gradle assemble of an Android project failed, can't find R.txt
So the way I fixed this was:
inside my androidTest folder, I had a java folder with my test files. But gradle requires you to have some resources inside test so that it generates the R.txt file. So what I did was created a res folder inside androidTest and added a values/strings.xml folder with one string resource.
This allowed my tests to build and run!