Ionic build error : You have not accepted the license agreements of the following SDK components: [Android SDK Platform 24] : <p>I'm trying to run the command <code>ionic build android --release</code> to build the apk but i am getting this error </p>

<blockquote>
  <p>Total time: 1.767 secs Error: cmd: Command failed with exit code 1
  Error output: FAILURE: Build failed with an exception.</p>
  
  <ul>
  <li><p>What went wrong: A problem occurred configuring root project 'android'.</p>
  
  <blockquote>
    <p>You have not accepted the license agreements of the following SDK components: [Android SDK Platform 24]. Before building your project,
    you need to accept the license agreements and complete the
    installation of the missing components using the Android Studio SDK
    Manager. Alternatively, to learn how to transfer the license
    agreements from one workstation to another, go to
    <a href="http://d.android.com/r/studio-ui/export-licenses.html">http://d.android.com/r/studio-ui/export-licenses.html</a></p>
  </blockquote></li>
  <li><p>Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Picked up _JAVA_OPTIONS: -Xmx512M</p></li>
  </ul>
</blockquote>
