方法名称中的€签名使用Gradle失败测试用例

时间:2014-08-14 13:34:47

标签: android testing gradle gradlew

我使用的是Windows 8作为操作系统。 我在Robolectric中有一个测试方法,其方法名称为€。当我使用带有gradlew test命令的Android studio中的Gradle包装器运行测试时, 它显示我跟随错误:

error: illegal character: \172
    public void change_Ôé¼10() {
                                                           ^
2 errors                                     
:client:compileTestDebugJava FAILED          

FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ':client:compileTestDebugJava'.
> Compilation failed; see the compiler error output for details.

Try:        
Run with --stacktrace option to get the stack trace. Run with --info or --debug

BUILD FAILED  

我已经研究过它并发现它可能与编码为UTF-8有关 我似乎需要在没有BOM的情况下使用它:

Illegal Character when trying to compile java code

Android Project Compiled with Ant doesn't compile, Illegal Character Error

但我不知道如何正确地修复它。你有什么建议在Android工作室终端修复吗?

补遗:我的一位使用Linux的朋友没有办法运行测试。

1 个答案:

答案 0 :(得分:3)

解决此问题的正确方法是从方法名称中删除字符。

我不知道任何实际的限制 - 你提到它适用于Linux机器 - 但这是一种可怕的做法。只需拼出单词

即可