Android Studio 中 FAILURE: Build failed with an exception. * What went wrong: Execution failed for ta

来源:互联网 发布:windows即将过期怎么办 编辑:程序博客网 时间:2024/05/17 05:07

声明:转载自 第七城市

完整的问题提示

Gradle: FAILURE:Build failed with an exception.*What went wrong:Execution failed for task ':compileDebugAidl'.>No signature of method: com.android.ide.common.internal.WaitableExecutor.waitForTasks()is applicable for argument types:() values:[]Possible solutions: waitForAllTasks()*Try:Runwith--stacktrace option to get the stack trace.Runwith--info or--debug option to get more log output.但是这个提示我们却不知道干嘛看了StackOver http://stackoverflow.com/questions/16682443/android-studio-gradle-build-fails-execution-failed-for-task-compiledebugai上的解答我是明白了,是要到根目录(也就是找到gradlew.bat这个文件)下运行,打开命令行
接着就会出现完整的提示,运行发现居然是字符编码的问题,一口老血喷了一地测试 了一下,把那些中文改为英文后发现真的没问题了,我的一个下午啊。问题是知道了,就是我们不能写中文或者把文件换成GBK编码,不然编译的时候是会以GBK编码编译的,然后就出错。但是咱们是中国人啊,不能不写中文啊。我继续找,最后在这篇博客上找到了解决方案http://blog.csdn.net/nono_love_lilith/article/details/9041813具体就是在下图中红色圈圈的 build.gradle 文件中添加一个东西,就是下面这个,让它以UTF-8的方式编译  tasks.withType(Compile) {    options.encoding = "UTF-8"}
就是在最后加入就可以了,最后编译通过,还是要默哀一下我的下午。还有仇视一下这坑爹的IDE难怪大神们一般都不用IDE

0 0
原创粉丝点击