Android Studio: Where is the Compiler Error Output Window?

GradleAndroid Studio

Gradle Problem Overview


When I 'Run' my project in Android Studio, in the 'Messages' window, I get:

Gradle: 
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':play01:compileDebug'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

It says > Compilation failed; see the compiler error output for details. So where is the "compiler error output"? And/Or how do I run with --stacktrace option?

Gradle Solutions


Solution 1 - Gradle

For Android Studio 3.1, select the icon below the Build one in the Build window.

Android Studio 3.1 raw log toggle button

By Android Studio 3.3 (possibly in 3.2.1), the icon has changed, though the location is the same:

Android Studio 3.3 raw log toggle button

The build window should open when you run a build action (e.g. from the Build menu). If you don't see it, you can try the "Build" button along the bottom of the window (also visible in the above screenshots), or through the menus View → Tool Windows → Build.

Solution 2 - Gradle

This answer is outdated. For Android 3.1 Studio go to this answer

One thing you can do is deactivate the external build. To do so click on "compiler settings icon" in the "Messages Make" panel that appears when you have an error. You can also open the compiler settings by going to File -> Settings -> Compiler. (Thanx to @maxgalbu for this tip).

enter image description here

Uncheck "Use External build"

enter image description here

And you will see the errors in the console

EDIT: After returning to "internal build" again you may get some errors, you can solve them this way: https://stackoverflow.com/questions/17108393/android-studio-disabling-external-build-to-display-error-output-create-duplic/17220509#17220509

Solution 3 - Gradle

It's really straightforward to set up! Just go to the Compiler settings at Android Studio 2.2.3 and set the --stacktrace command:

Compiler settings to add --stacktrace command

Then run the app again

Solution 4 - Gradle

Are you on Windows? Launch cmd, find your project folder and run "gradlew build". This should already give you more output than the IDE, you can also use --info, --stacktrace and --debug there.

Solution 5 - Gradle

In my case I prefer to open the Terminal window on the bottom left, and run gradlew build --info :

enter image description here

Solution 6 - Gradle

You can also see the error in the Build window by clicking on the toggle button.

enter image description here

Solution 7 - Gradle

For Android Studio v4.0

As others have mentioned, the "Messages" window that was evidently present in AS 3.* no longer exists in 4.0 (or else it's hidden very, very well). After wasting far too much time on this, I've found another way to view those compile errors:

  1. Open your Gradle tool window. By default, it's on the right edge toward the top:

enter image description here

If you don't see it there, use View > Tool Windows > Gradle.

  1. In the Gradle window, open your app's root option and run Tasks > build > build:

enter image description here

  1. The Run tool window should open automatically, where you'll see details about the cause of the build error:

enter image description here

If it doesn't open automatically, you can access it through View > Tool Windows > Run.

Hopefully that gives you all the info you need. If not though, try:

  1. Go to File > Settings > Build, Execution, Deployment > Compiler. In the Command-line Options, add --scan.

enter image description here

Apply and OK, then try the Gradle build over again.

Solution 8 - Gradle

In android studio 2.2.3 you can find output in the gradle console as shown below gradle console

Solution 9 - Gradle

I am building on what Jorge recommended. Goto File->Settings->compiler.

Here you will see a field to add compiler options where you plug in --stacktrace

Solution 10 - Gradle

Run

gradlew --stacktrace 

in a terminal to see the full report

for me it was > Task :app:compileDebugJavaWithJavac FAILED javacTask: source release 1.8 requires target release 1.8

so i added

 compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

in app.gradle file / android and the build completed successfully

Solution 11 - Gradle

Just click on the "Build" node in the Build Output

enter image description here

From some reason the "Compilation failed" node just started being automatically selected and for that the description window is very unhelpful.

Solution 12 - Gradle

If you are in android studio 3.1, Verify if file->Project Structure -> Source compatibility is empty. it should not have 1.8 set.

then press ok, the project will sync and error will disappear.

Solution 13 - Gradle

In my case i had a findViewById reference to a view i had deleted in xml

if you are running AS 3.1 and above:

  1. go to Settings > Build, Execution and Deployment > compiler
  2. add --stacktrace to the command line options, click apply and ok
  3. At the bottom of AS click on Console/Build(If you use the stable version 3.1.2 and above) expand the panel and run your app again.

you should see the full stacktrace in the expanded view and the specific error.

Solution 14 - Gradle

after the convert android to androidx.

change Import library problem will sol. Like this:

import androidx.appcompat.widget.Toolbar;  <<  like this

import androidx.annotation.NonNull; << like this

import androidx.appcompat.app.ActionBarDrawerToggle; << like this

import androidx.drawerlayout.widget.DrawerLayout; << like this

import androidx.recyclerview.widget.RecyclerView; << like this

import androidx.appcompat.app.AppCompatActivity; << like this

Solution 15 - Gradle

Follow these steps!

  1. Go to File

  2. Then click on Settings

  3. Then under "Build, Execution, Deployment" go to Compiler

  4. Add this in "Command-line Options" and press OK enter image description here

  5. Now normally run your test/app again and when you will encounter error this time, you will see highlighted messages like this : enter image description here

  1. Clicking on "Run with --scan" or "Run with --stacktrace" will give error in more detail.

Solution 16 - Gradle

I solved this error "Compilation failed to see the compiler error output for details"

The solution is very Simple: Add in a Gradle below a line of code

implementation 'com.google.android.gms:play-services-ads:15.0.0'

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionChaseTheSunView Question on Stackoverflow
Solution 1 - GradleboiledwaterView Answer on Stackoverflow
Solution 2 - GradleJorge Fuentes GonzálezView Answer on Stackoverflow
Solution 3 - GradleAntonioView Answer on Stackoverflow
Solution 4 - GradleHadi KocabasView Answer on Stackoverflow
Solution 5 - GradleRominaVView Answer on Stackoverflow
Solution 6 - Gradlelive-loveView Answer on Stackoverflow
Solution 7 - GradlekittykittybangbangView Answer on Stackoverflow
Solution 8 - Gradlecahit beyazView Answer on Stackoverflow
Solution 9 - GradlejaiView Answer on Stackoverflow
Solution 10 - GradleFalah H. AbbasView Answer on Stackoverflow
Solution 11 - GradleJan MálekView Answer on Stackoverflow
Solution 12 - GradleLogesh RView Answer on Stackoverflow
Solution 13 - GradlePeterstev UremgbaView Answer on Stackoverflow
Solution 14 - GradleAhmadUllah AhmadView Answer on Stackoverflow
Solution 15 - GradleoyeraghibView Answer on Stackoverflow
Solution 16 - GradleShah HussainView Answer on Stackoverflow