Ran into this in https://chromium-review.googlesource.com/c/chromium/src/+/769348
Robolectric assumes that all R.java files that define a resource define it with the same ID. This is true for android_apk() targets because they run a final process_resources() step. Currently though, junit_binary is just pulling in the intermediary R.java files, which define different values for the same resources.
To fix this, we can either pass robolectric the list of all R class files, and have it rewrite all of them at runtime (tested that this works, but it's a bit slow and not how the problem is solved in any other build system), or we can add a call to process_resources() to junit_binary (we should do it this way to be consistent).
Comment 1 by bugdroid1@chromium.org
, Nov 16 2017