0

Using Android Studio, when I try to run all my Unit Tests, it fails almost immediately with following error in Messages (Gradle Build):

Error:Gradle: Content is not allowed in prolog.
Error:Gradle: Execution failed for task ':Module:mergeDebugAndroidTestResources'.
      > /Users/me/path/to/my/project/src/test/resources/fixtures/activity_feed.json:0:0: Error: Content is not allowed in prolog.

Seems like yet another variant of Content is not allowed in prolog error, which doesn't often makes sense, as I found out searching for a solution. In my case, it points to a JSON file, which obviously doesn't contain any prolog code.

Marcel Bro
  • 4,907
  • 4
  • 43
  • 70
  • For the most part those issues are some weird character at the beginning of the file. Would the solutions in http://stackoverflow.com/questions/4569123/content-is-not-allowed-in-prolog-saxparserexception work for a json file? – loosebazooka Jul 14 '15 at 21:33

1 Answers1

0

Find Build Variants view:

  • left tool pane
  • View -> Tool Windows -> Build Variants

Once there, locate:

Test Artifact: Android Instrumentation Tests

and instead Android Instrumentation Tests select:

Test Artifact: Unit Tests

Marcel Bro
  • 4,907
  • 4
  • 43
  • 70