Android(安卓)Studio 中 FAILURE: Build failed with an exception. * What went wrong: Execution failed for
16lz
2021-01-25
完整的问题提示
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这个文件)下运行,打开命令行运行 “gradlew compileDebug --stacktrace"
接着就会出现完整的提示,运行发现居然是字符编码的问题,一口老血喷了一地
测试 了一下,把那些中文改为英文后发现真的没问题了,我的一个下午啊。
问题是知道了,就是我们不能写中文或者把文件换成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
更多相关文章
- 没有一行代码,「2020 新冠肺炎记忆」这个项目却登上了 GitHub 中
- 一款常用的 Squid 日志分析工具
- GitHub 标星 8K+!一款开源替代 ls 的工具你值得拥有!
- RHEL 6 下 DHCP+TFTP+FTP+PXE+Kickstart 实现无人值守安装
- Linux 环境下实战 Rsync 备份工具及配置 rsync+inotify 实时同步
- 模拟器调试中动态链接库的替换
- 【Android(安卓)开发教程】重新布局
- Mac Android(安卓)Studio处理unable to access android sdk add-
- 用Java模拟表单(或iPhone、Android客户端)上传文件