Error:Compilation failed; see the compiler error output for details.

Error:Compilation failed; see the compiler error output for details

如何查看错误信息?

在命令行中进入项目的根目录,或者可以在Android studio的Terminal中直接操作也可以,然后敲入一个命令:

1
gradlew compileDebug --stacktrace

就可以输出较详细的信息,然后根据命令行给出的提示,还可以在后面加上-info或者-debug的选项得到更详细的信息,于是这个命令可以这样写:

1
gradlew compileDebug --stacktrace -info
1
或者:gradlew compileDebug --stacktrace -debug

查找后,我又用上面博主提供的方法用了这个命令

1
gradlew compileDebugSources --stacktrace -info

最后找到了这个

1
2
3
gradlew command not found
则执行:
sudo chmod +x gradlew

值得一提的是,mac下执行当前目录下的命令需要在前面加上“./”,否则会到环境变量下找相应命令。例如

1
./gradlew javadocJar
文章目录