Android Stuido : see the compiler error output for details.

通常在Android Studio编译中,经常会出现一些错误,提示信息大概是类似"xxxx,see the compiler error output for details.",我们从中得不到比较有效的信息。
Terminal中输入以下命令,可以得到更为有效的编译信息:
gradlew compileDebug --stacktrace
如果想得到更详细的信息,可以在以上命令后面增加-info或'-debug'比如gradlew compileDebug --stacktrace -info

或者尝试gradlew compileDebugSources --stacktrace -info命令
参考资料:https://blog.csdn.net/runner__1/article/details/53482565

关于Mac下`gradlew: command not found

引起原因:gradlew不在系统全局变量路径中,当执行命令时会报错,提示找不到。

解决办法1:

因为没有在全局变量路径中设置gradlew,所以找不到gradlew命令,那么我们可以使用gradlew的绝对路径来使用命令:{绝对路径}/gradlew {cmd}..,比如{绝对路径}/gradlew compileDebug --stacktrace -info
gradlew的绝对路径通常是在Android工程的根目录下。因此在Android Studio的Terminal中使用gradlew命令,则可以使用./指定当前目录,即./gradlew {cmd}的形式,比如./gradlew compileDebug --stacktrace -info

解决办法2:

配置全局环境变量

  • 找到gradle文件所在路径。该文件可在Android Studio安装目录下找到,如:/Applications/Android Studio.app/Contents/gradle/gradle-2.14.1/bin

  • 配置.bash_profile文件。
    在文件中添加如下内容:export PATH=${PATH}:/Applications/Android\ Studio.app/Contents/gradle/gradle-2.14.1/bin
    注意AndroidStudio单词间的 \ + 空格。

  • 使.bash_profile文件立刻生效。在终端执行:source .bash_profile

资料参考:https://blog.csdn.net/lvxiangan/article/details/70844264

你可能感兴趣的:(Android Stuido : see the compiler error output for details.)