zoukankan      html  css  js  c++  java
  • Android Studio 中 FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':compileDebugAidl'.的问题解答

    Android Studio 中 FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':compileDebugAidl'.的问题解答

    完整的问题提示

    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/questio ... task-compiledebugai
    上的解答我是明白了,是要到根目录(也就是找到gradlew.bat这个文件)下运行,打开命令行运行 “gradlew compileDebug --stacktrace"
    <ignore_js_op>
    接着就会出现完整的提示,运行发现居然是字符编码的问题,一口老血喷了一地
    <ignore_js_op>
    测试 了一下,把那些中文改为英文后发现真的没问题了,我的一个下午啊。
    问题是知道了,就是我们不能写中文或者把文件换成GBK编码,不然编译的时候是会以GBK编码编译的,然后就出错。
    但是咱们是中国人啊,不能不写中文啊。我继续找,最后在这篇博客上找到了解决方案
    http://blog.csdn.net/nono_love_lilith/article/details/9041813
    具体就是在下图中红色圈圈的 build.gradle 文件中添加一个东西,就是下面这个,让它以UTF-8的方式编译

      tasks.withType(Compile) {
        options.encoding = "UTF-8"
    }
    <ignore_js_op>
    就是在最后加入就可以了,最后编译通过,还是要默哀一下我的下午。还有仇视一下这坑爹的IDE
    难怪大神们一般都不用IDE
    <ignore_js_op>

  • 相关阅读:
    【Linux】ZeroMQ 在 centos下的安装
    ZeroMQ下载、编译和使用
    在Linux系统上安装Git
    Linux下python2.7安装pip
    [Tyvj1474]打鼹鼠
    [BZOJ2908]又是nand
    [SPOJ375]Qtree
    浅谈算法——树链剖分
    [BZOJ5368/Pkusc2018]真实排名
    [FJOI2007]轮状病毒
  • 原文地址:https://www.cnblogs.com/McCa/p/4415930.html
Copyright © 2011-2022 走看看