Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are Gradle logs?

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.

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.

like image 428
Hong Avatar asked Feb 22 '16 16:02

Hong


People also ask

Where can I find Gradle logs?

Gradle does not redirect its logs in a separate file in Android Studio. 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. This command will redirect all standard output and error messages from gradle build to a file called myLogs.

Where do Gradle build files go?

gradle file is located inside your project folder under app/build.

What logger does Gradle use?

Internally, Gradle uses Ant and Ivy. Both have their own logging system.


2 Answers

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

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 

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 

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

Tested on Windows 10 and works perfectly.

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

like image 187
Krasimir Stoev Avatar answered Sep 20 '22 16:09

Krasimir Stoev


View -> Tool Windows -> Build.

There is small "ab" button on the left panel.

enter image description here

All gradle logs for current build are there.

enter image description here

EDIT: There is new icon from AndroidStudio 3.3

enter image description here

like image 44
ashakirov Avatar answered Sep 20 '22 16:09

ashakirov