Where are Gradle logs?

前端 未结 3 722
庸人自扰
庸人自扰 2020-12-02 10:33

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

Error:Execution failed for task \':app:compileDebugJavaWithJavac\'.
> java.lang.R         


        
相关标签:
3条回答
  • 2020-12-02 10:37

    View -> Tool Windows -> Build.

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

    All gradle logs for current build are there.

    EDIT: There is new icon from AndroidStudio 3.3

    0 讨论(0)
  • 2020-12-02 10:42

    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.

    0 讨论(0)
  • 2020-12-02 10:57

    You can also try running your task like this:

    >gradlew --info build

    You will get a bunch of useful log information

    0 讨论(0)
提交回复
热议问题