24

I want to know how to show compilation errors in Android Studio. I tried the following one:

Android Studio: Where is the Compiler Error Output Window?

But it is showing another error:

javac: invalid target release: 1.8

Anybody who knows the actual solution please reply.

Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
iamcrypticcoder
  • 2,609
  • 4
  • 27
  • 50

6 Answers6

26

There is a 'Problems' view in the project window:

Project window - click on drop down and select 'Problems'

Just click on the drop down (Android setting is default) and select 'Problems'. Not comparable to eclipse problems view tough...

Lonzak
  • 9,334
  • 5
  • 57
  • 88
  • 1
    Android Studio 3.1.1 ... seems as if the problems-view does not update automatically. Have to click on another tab and then back on `problems` to see new problems. If I fix a typo, it updates and removes the typo from the problems-view. – hamena314 Apr 28 '18 at 20:38
  • 5
    Pretty worthless really. Both Eclipse and Netbeans handle this much better. – Stephen M -on strike- May 31 '18 at 19:37
  • 1
    The absurdity is that the problems view is probably the second most accessed view and yet its hard to find. – Brett Sutton Jun 26 '20 at 01:38
  • Eclipse is better in all... I hate Android Studio with all my soul – vLopez Jul 21 '21 at 10:39
11

Using F2

In addition to what the other answers say, you can find errors by pressing F2 or Shift+F2. This is useful when you can't see the where the red indicator is on the side bar.

enter image description here

Community
  • 1
  • 1
Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
5

There's "Messages" tab in Android Studio. Complilation errors and warning go there. You can select it by pressing alt+0 (⌘+0 in OS X - a shortcut to View|Tool Windows|Messages).

Geeks On Hugs
  • 1,591
  • 2
  • 18
  • 31
ernazm
  • 9,208
  • 4
  • 44
  • 51
  • "javac: invalid target release: 1.8" is showing in the Messages tab. I need to see java compilation errors. – iamcrypticcoder Jun 22 '13 at 17:41
  • Normally, there should be compilation errors too. You probably have jdk 1.8 which is (probably) not compatible with Android Studio. I'd try to switch to 1.7. – ernazm Jun 23 '13 at 12:26
  • Actually I'm working on android studio for last 2 months. Everything is okay. No problem to build if there is no compilation error. But if there are compilation errors "Messages Tab" shows "Compilation error bla bla..." but don't show errors. That's it. If jdk 1.8 is not compatible to Android Studio, is it impossible to build. – iamcrypticcoder Jun 23 '13 at 12:36
  • Well the error message you posted says there's something wrong with javac you have, I think that's why you get no compilation errors. It's up to you whether to spend 5 minutes to try 1.7 jdk and see compilation errors or go as is. – ernazm Jun 23 '13 at 13:15
  • ⌘+0 in OS X - a shortcut to View|Tool Windows|Messages – Geeks On Hugs May 30 '14 at 02:21
  • I don't think this exists in AS anymore. – Julian A. Jun 29 '20 at 17:12
5

I was looking for the "Problems" view that you can see in Eclipse when building projects. For that, you can go to Analyze -> Inspect Code

Where is the warnings view in Android Studio?

and then I clicked on "Group by Severity" so that I could see the warnings and errors.

Community
  • 1
  • 1
Lou Morda
  • 5,078
  • 2
  • 44
  • 49
4

In the toolbar, go to Analyze -> Inspect Code

After That, you will have the Inspection Results window with the detailed errors and warnings. see image:

The Inspection Results window

Hesham Yassin
  • 4,341
  • 2
  • 21
  • 23
  • This is pretty useful, but I wish Android Studio did this on the fly. For example, if you remove a function, a window to show all instances where that function is being called as errors. – gunner_dev Jul 31 '18 at 15:41
0

Next / Previous highlighted error: F2/Shift + F2

Show descriptions of error at caret: Ctrl+F1

Manishoaham
  • 601
  • 1
  • 5
  • 14