0

Not long time ago I checked all the lint options in Android Studio. I thought they were only meant for analyze->inspect code and while working with the project I worked on, it was ok.

Now I started a new project and it's affecting it completely, giving me a lot of lint warnings that sometimes contradict one another.

When I checked it manually in my previous project, I could ignore them but now I have a lot of Yellow marks in my code.

How can I factory reset the lint options of Android studio? There is "reset to default settings" but I think I ruined the defaults. If it's not possible, is there a default lint.xml that I can force it to use?

Please help, I'm drowning with Yellows... Thanks

EDIT: I downloaded Android Studio from scratch, reopen the project and the Yellow marks are still there...

Amos
  • 1,321
  • 2
  • 23
  • 44

2 Answers2

1

This can be done in your module-level build.gradle file. Add the following lintOption inside your android closure .

The lint tool checks your Android project source files for potential bugs and optimization improvements for correctness, security, performance, usability, accessibility, and internationalization .

       lintOptions {
          abortOnError false //Whether lint should set the exit code of the process if errors are found
      }
IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198
  • 1
    Thanks but the problem is not that running is failing or a compilation error, just the fact there are a lot of yellow marks that I can't get rid off. They even contradict one another so one mark is telling me there is no constructor (mainactivity) and when I add an empty one, a new mark is telling me it is not needed. The defaults made sense and were kind to me but now I messed things up. – Amos Aug 30 '17 at 11:53
  • 1
    Thanks, I went to other settings->default settings->editor->inspections and it looks ok (I think, there are a lot of options) but I still get, for example, a lint warning about a missing constructor "Class... has no constructor" and "Class... has public default constructor" both for the same class (2 marks). I don't remember having them in the past and the yellow bulb does not let me ignore/delete/change the relevant settings so maybe I'm missing something? – Amos Aug 30 '17 at 12:02
  • 1
    The option JavaBeans issues->class without constructor and class without no arg constructors are both unchecked for both default and project default and still I get Class... has no constructor. I think I'm missing something not-related to lint itself but it's only a guess. – Amos Aug 30 '17 at 12:08
0

Eventually I ended up renaming the project's original folder, downloaded Android Studio from the internet, created a new project and copied the relevant files/code from the original folder. Now it's back to normal.

Amos
  • 1,321
  • 2
  • 23
  • 44