"License for package Android SDK Build-Tools 30.0.2 not accepted"

I just installed Android Studio on a new device and during my first project I get this error:

License for package Android SDK Build-Tools 30.0.2 not accepted.

Please, what should I do?


Solution 1:

In Android Studio:

  • Go to Tools -> SDK Manager
    Tools > SDK Manager
  • Select Android SDK and then the SDK Tools tab
  • Mark the Google Play Licensing Library and click on OK to install it Android SDK - SDK Tools - Google Play Licensing Library

Now your error should be all gone, if not, restart your Android Studio.

Solution 2:

I got exactly same error on Windows 10 but above solution didn't work for me. As this error was specially pointing towards 30.0.2, I checked in Android Studio under Tools>>SDK Manager>> SDK Platforms and found that only latest Android 12.0(S) with API level 31 was installed. I checked Android 11.0(R) to install API level 30 and error got resolved. Screenshot for solution