【发布时间】:2015-07-14 15:33:49
【问题描述】:
使用 Android Studio,当我尝试运行所有单元测试时,它几乎立即失败,并在 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.
似乎 Content is not allowed in prolog 错误的另一种变体,这通常没有意义,因为我发现正在寻找解决方案。在我的例子中,它指向一个 JSON 文件,该文件显然不包含任何序言代码。
【问题讨论】:
-
在大多数情况下,这些问题是文件开头的一些奇怪字符。 stackoverflow.com/questions/4569123/… 中的解决方案是否适用于 json 文件?
标签: android unit-testing android-studio