As stated in the error message, this error happens because you have not accepted the android SDK licenses yet.
To resolve it, navigate to the folder
$ANDROID_HOME/tools/bin/ (The path is likely ~/Library/Android/sdk) using your command line or terminal and then run:
./sdkmanager –licenses (on linux/macos) or sdkmanager --licenses (on windows)
There will be some prompts asking you to accept the licenses, just go accept them as you need to.