216

I want to see warnings of my code in Android Studio, But i am unable to find the option to display warnings view. In case of eclipse we can see the warnings in the "Problems" view.

Can anyone suggest me, how to view warnings in android studio?

Zoe
  • 27,060
  • 21
  • 118
  • 148
Raghu Mudem
  • 6,793
  • 13
  • 48
  • 69

7 Answers7

290

If, on the toolbar, you click Analyze -> Inspect Code; then in the window that pops up select how much of your project you want to inspect (I usually do Whole Project, but you might want to select a specific module), then click okay.

Android Studio will work for a bit, then the inspection window will pop up from the bottom with a list of results, subdivided by inspection.

Lii
  • 11,553
  • 8
  • 64
  • 88
Brenden Kromhout
  • 4,607
  • 1
  • 16
  • 13
  • 52
    This does not show Java compiler warnings, but Android Lint issues! – sschuberth Jan 14 '15 at 13:09
  • 4
    That depends on the inspection profile you have selected! You can run a lot of inspections, including Java! – lage Aug 11 '15 at 10:56
  • on Studio 1.5, this method displays ALL the issues, not only the ones related to Lint as explained by lage – Yoann Hercouet Dec 15 '15 at 15:50
  • 1
    on Studio version 2, it does not show any warnings (though my codes have obvious issues marked in yellow). Potential bug? – Raptor Jan 28 '16 at 10:19
  • To analyze current file, press Alt + Shift + i. (For Windows) – Chintan Shah Oct 20 '16 at 07:07
  • @Raptor For me AS 2 also doesn't show any warnings when running "Analyze/Inspect code" although warnings are displayed in the source code. Did you find a solution? – Sven Jacobs Nov 03 '16 at 06:21
  • 1
    In my file, all my warnings are on the fields, and say "Make private." It is very time-consuming to press "Alt + Enter" in order to make each individual field have a modifier of private. Is it possible to resolve all the warnings at once in order to have all the fields made private at once? – Shikhar Mainalee Mar 20 '19 at 23:01
48

Build -> Make Project (Ctrl + F9) gives what we can get equivalent of Eclipse's “Problems” view on Android Studio

Sourab Sharma
  • 2,940
  • 1
  • 25
  • 38
  • 1
    Agree, I really don't get why this isn't what you see when you hit "run" and it errors out. Really need a way to pull up this view when you build that way. – vitriolix Dec 19 '15 at 00:03
26

you can use F2 to next problems, see more here: Navigating to Next/Previous Error

vuhung3990
  • 6,353
  • 1
  • 45
  • 44
  • This felt like the most usable to me on a file by file basis. I just looked for the yellow in the sidebar to see if I needed to hit F2. – SilentNot Nov 30 '17 at 16:04
  • After hitting F2 the warning or error displays on the status portion of the main window. – mkdave99 May 17 '19 at 13:32
5

GO to View-->Tool Windows-->Messages to view the warnings

sharath
  • 51
  • 1
  • 2
3

Even i searched all the settings in Android Studio, but couldn't find a separate window for it. The warnings are actually visible to the right end of a particular line as a small yellow marker and clicking on that show the warnings in the status bar below. The colors of them can be editted in the inspection options.

Hope this helps you.

Vinuthan
  • 1,035
  • 2
  • 12
  • 20
  • Thanks for responding me. You are right but i need the warning screen shot for my project. – Raghu Mudem Jun 20 '13 at 08:57
  • @vinuthan after running the Analyze / Inspect Code as per the above answer, you will get all the warnings in the Inspect tab – Erwan Feb 19 '14 at 04:29
  • 2
    What about for errors such as "Cannot resolve symbol 'xyz'"? Eclipse would show all this in a long errors/warnings view. Can this view be made to work similarly? – Manius Jan 02 '15 at 21:08
  • Thanks, that was what I was looking for. Easy to miss that. – Alice Apr 24 '16 at 09:46
2

The closest thing Android Studio/IntelliJ has to the Problems view in Eclipse is to use the Problems section of the Project tool window. With that open, navigate down to any classes that appear there and open them in the editor. Once in the editor, you can use F2 to jump between errors in the open file.

Unfortunately, IntelliJ's Problems tool window shows classes with errors nested by folder/package, so you have to expand several levels and it takes up a lot of screen real estate to see even one error. It also doesn't list the errors individually, forcing you to first open the problematic file and then use F2 to navigate to each one. I also had the problem that errors in files that weren't open, didn't show up there.

onlynone
  • 7,602
  • 3
  • 31
  • 50
0

[opening warning screen in android studio

  • Click the warning icon as marked in the image.
  • Warning screen will open.

][click to see image] here