While building the flutter application an error occurred saying android sdk licenses not accepted. So, while accepting the license this error occurred.
Reason for this error in my case was I haven't installed sdkmanager command line tools which is required to accept the license.
So, to install command line tools easiest way is:
- Open android studio.
Open android studio.
- Open SDK Manager (refer image below):
Open SDK Manager (For Old Android Studio):


Open SDK Manager (For New Android Studio):

Select SDK tools inside it in bar.
Tick the option Android SDK Command-line Tools (latest)
Apply it.
Run flutter doctor -android-licenses if using flutter or you can continue with the process where the error occurred.
- Select SDK tools inside it in bar.
- Tick the option Android SDK Command-line Tools (latest)
- Apply it.
- Run flutter doctor -android-licenses if using flutter or you can continue with the process where the error occurred.