title: Cannot build android as some licenses have not been accepted
body: <p>I'm trying to setup an android command line compiler in a linux machine, so I downloaded the command line tools for Android, and downloaded the Android 12 platform (android-31), <strong>as well as all the build tools</strong>.</p>
  <p>I decided to have a system wide installation, so I did the process in <code>/opt/android-sdk</code>. And of course I wrote the <code>ANDROID_SDK_ROOT</code> variable to point to that path. Once finished the installation, I accepted the licenses with <code>sdkmanager --licenses</code>.</p>
  <p>As it was a system wide installation, I set the ownership of the <code>/opt/android-sdk</code> folder (and all subfolders) to <code>root:android</code>. So all users in group android can read/write those files.</p>
  <p>Now, when I try to compile a project, it gives the following error:</p>
  <pre><code>Failed to install the following Android SDK packages as some licences have not been accepted.
       patcher;v4 SDK Patch Applier v4
       emulator Android Emulator
       platforms;android-31 Android SDK Platform 31
       tools Android SDK Tools
       build-tools;31.0.0 Android SDK Build-Tools 31
       platform-tools Android SDK Platform-Tools
    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
    
    Using Android SDK: /opt/android-sdk
  </code></pre>
  <p>If you see the list of installed packages:</p>
  <pre><code>Installed packages:
    Path                 | Version | Description                    | Location
    -------              | ------- | -------                        | -------
    build-tools;30.0.3   | 30.0.3  | Android SDK Build-Tools 30.0.3 | build-tools/30.0.3
    build-tools;31.0.0   | 31.0.0  | Android SDK Build-Tools 31     | build-tools/31.0.0
    emulator             | 30.9.5  | Android Emulator               | emulator
    patcher;v4           | 1       | SDK Patch Applier v4           | patcher/v4
    platform-tools       | 31.0.3  | Android SDK Platform-Tools     | platform-tools
    platforms;android-31 | 1       | Android SDK Platform 31        | platforms/android-31
  </code></pre>
  <p>And the licenses folder:</p>
  <pre><code>-rwxrwxr-x 1 root android 41 Nov 18 10:34 android-googletv-license
  -rwxrwxr-x 1 root android 41 Nov 18 10:34 android-sdk-arm-dbt-license
  -rwxrwxr-x 1 root android 41 Nov 18 10:30 android-sdk-license
  -rwxrwxr-x 1 root android 41 Nov 18 10:34 android-sdk-preview-license
  -rwxrwxr-x 1 root android 41 Nov 18 10:34 google-gdk-license
  -rwxrwxr-x 1 root android 41 Nov 18 10:34 mips-android-sysimage-license
  </code></pre>
  <p>Is there something that I'm missing? Any kind of permission error or any step that I need to do?</p>
  <p>When I downloaded the packages, it asked for confirmation on the license for <code>platforms;android-31</code>, but no any other package. Maybe there was something missing in at that moment.</p>