1、打开cmd,进入项目的gradle所在目录
2、键入gradlew compileDebug --stacktrace或gradlew compileDebugSources --stacktrace -info进行追踪
3、根据提示错误,将compileDebug改成出现的错误类型,例如 gradlew compileDebugJavaWithJavac --stacktrace --debug
如果不行,再参考以下链接解决:
https://www.jianshu.com/p/fdb9fd99314d