Android Stuido : see the compile

2018-04-25  本文已影响22人  SupLuo

通常在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:

配置全局环境变量

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

上一篇 下一篇

猜你喜欢

热点阅读