【Android Studio】Failed to install the following Android SDK packages as some licences have not been accepted.エラーが発生する

Android Studio4.1.1を利用していたが、別PCに4.2.1を構築し、以前作成したソースを持ってきて実行しようとしたところ、以下のエラーが発生した

Failed to install the following Android SDK packages as some licences have not been accepted.
   build-tools;30.0.2 Android SDK Build-Tools 30.0.2
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

「licences have not been accepted」とあるので、調べたところ「sdkmanager –licenses」を実行すれば良いとあったが、効果が無かった。

原因が分からなかったが、4.2.1で新規に作成したソースだと動作しているため差を確認したところ、build.gradleのbuildToolsVersionが30.0.3となっていたため、ここを同じように30.0.2から30.0.3に書き換えることで動作した!