Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio Messages window

How can I configure Android Studio/IntelliJ Idea to show more than 101 error messages when compiling?

I know there are more than 101 errors, but I am using Android Annotations and I get a lot of import errors when something is wrong. Those import errors fill up the messages window and I can't see the actual errors that need to be fixed.

Thanks!

example

like image 631
Andrei Verdes Avatar asked Oct 18 '22 15:10

Andrei Verdes


2 Answers

This 101 error limit is imposed by the underlying compiler , not the IDE. So to increase it, you have to change the default compiler settings.

Go To : Preferences -> Build, Execution, Deployment -> Compiler.

There, you'll find an option of passing additional command line options to the compiler. There you can change the max errors limit.

The compiler used by Android studio is javac and it offers the following options :

-Xmaxerrs number : Set the maximum number of errors to print.

-Xmaxwarns number : Set the maximum number of warnings to print. `

So, you can pass :

-Xmaxerrs 400 -Xmaxwarns 1000 to make the maximum errors reported to 400 and maximum warnings reported to 1000.

That's one way to do it in IDE UI and change it globally for all projects.

You can also set this for a specific project by passing these command line options to the compiler through the gradle file of the project. Here's the syntax for that:

gradle.projectsEvaluated {
    tasks.withType(JavaCompile) {
    options.compilerArgs << "-Xmaxerrs" << "400" << " -Xmaxwarns" << "1000"
}
like image 182
Yash Avatar answered Oct 21 '22 09:10

Yash


In Gradle, change the allprojects of your Project build.gradle as following:

allprojects {
    repositories {
        jcenter()
    }

    // Allow 400 errors.
    gradle.projectsEvaluated {
        tasks.withType(JavaCompile) {
            options.compilerArgs << "-Xmaxerrs" << "400"
        }
    }
}
like image 31
Nishant Avatar answered Oct 21 '22 09:10

Nishant