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?
Run
in a terminal to see the full report
for me it was
so i added
in app.gradle file / android and the build completed successfully
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
For Android Studio 3.1, select the icon below the Build one in the Build window.
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.
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.
It's really straightforward! Just go to the Compiler settings at Android Studio 2.2.3 and set the
--stacktrace
command:Then run the app again