You have not accepted the license agreements of the following SDK component

Thanks bro! This was the easiest way.

ionic cordova platform update android@6.2.3

solved the issue for me.

/Applications/adt-bundle/sdk/tools/bin/sdkmanager --update or
$ANDROID_HOME/tools/bin/sdkmanager --update

The Best answer
%ANDROID_HOME%\tools\bin\sdkmanager --licenses

Works like charm

Where do I need to write this? Does this work on windows?

Run Command Prompt as Administrator.
copy and paste in it and hit enter

%ANDROID_HOME%\tools\bin\sdkmanager --licenses

where to run this command ?

This solutions works for me too with Api 26.
Thank you

This works great for me on Ubuntu 18.04!

This works, thank you so much!

Thank you for sharing this information.