Gradle日志在哪里? [英] Where are Gradle logs?

查看:1240
本文介绍了Gradle日志在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android Studio中为应用程序的Gradle构建会产生以下错误:

Gradle build for an app in Android Studio generates the following error:

Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> java.lang.RuntimeException: failure, see logs for details.
cannot generate view binders com.sun.tools.javac.code.Symbol$CompletionFailure: class file for android.view.View$InvalidateInfo not found

任何人都可以提供有关在哪里找到日志的提示吗?

Could anyone offer a tip on where to find the logs?

最初,我认为这是一个非常基本的问题,简单的答案会在顶部弹出以便快速搜索,但是我找不到它.

Initially I thought this was such a rudimentary question that the simple answer would pop up at the top for a quick search, but I failed to find it.

请注意,此问题是关于日志的 ,而不是针对此特定错误.此错误消息仅用作示例.如果您感到好奇,则此特定错误是由于在build.gradle中未对compileSdkVersion使用最新版本(23)引起的.

Please note this question is about the logs, not for this specific error. This error message is used just as an example. In case you are curious, this specific error was caused by not using the latest version (23) for compileSdkVersion in the build.gradle.

推荐答案

Gradle不会将其日志重定向到Android Studio中的单独文件中.

Gradle does not redirect its logs in a separate file in Android Studio.

因此,如果要在文件中查看它们,则需要使用终端中的命令来构建gradle,并将gradle输入重定向到文件.

Therefore if you want to view them in a file, you need to build gradle using a command in the terminal and redirect gradle input to a file.

gradlew build > myLogs.txt 2>&1

此命令会将所有标准输出和错误消息从gradle build重定向到项目文件夹中名为myLogs.txt的文件.

This command will redirect all standard output and error messages from gradle build to a file called myLogs.txt in the project folder.

gradlew build > myLogs.txt 2> logErrors.txt

此命令会将所有标准输出从Gradle日志重定向到myLogs.txt,并将所有错误消息重定向到logErrors.txt

This command will redirect all standard output from Gradle logs to the myLogs.txt and all error messages to logErrors.txt

在Windows 10上经过测试,可以完美运行.

Tested on Windows 10 and works perfectly.

此处有关如何将标准输出从命令重定向到其他文件的更多信息.

Here is more information about how to redirect standard output from commands to different files.

这篇关于Gradle日志在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆