error building android ionic project

I'm trying to build an example project from ionic. When I run the following the code, I get an error: ionic build android

I get this error ; * What went wrong: Execution failed for task ':compileDebugJava'.

Compilation failed; see the compiler error output for details.

Can someone tell me what to do?

Thanks in advance

Please try the following steps:

  1. ionic platform remove android

  2. ionic platform add android

  3. ionic build android

Have you installed the platform? In this working Mac or Windows? If you add ANDROID_HOME mac ?, If you add windows to your PATH location of the SDK?

Config Android_home osx

Config IONIC Android APP WINDOWS