Automatically accept all SDK licences

后端 未结 30 1777
感情败类
感情败类 2020-11-22 16:35

Since gradle android plugins 2.2-alpha4:

Gradle will attempt to download missing SDK packages that a project depends on

Which

相关标签:
30条回答
  • 2020-11-22 17:29

    If you are using Flutter just run:

    flutter doctor --android-licenses 
    

    And accept all the licenses needed.

    0 讨论(0)
  • 2020-11-22 17:30

    You can accept all the license by executing the following command:

     sdkmanager --licenses
    

    This will prompt you through each licenses you haven't accepted yet and you can just enter y to accept each of them.

    0 讨论(0)
  • 2020-11-22 17:30

    As of July 2019, the easiest method is to use: flutter doctor --android-licenses in the command prompt.

    It proceeds to display the unaccepted T&C of SDKs one by one and you're given option to choose 'y/n'. Choose y for all.

    Alternately, when you run flutter doctor, it will run Android toolchain diagnostics which displays how many licenses are not yet accepted, and suggests you to run it with the --android-licenses flag.

    0 讨论(0)
  • 2020-11-22 17:32

    for windows, open cmd and enter into bin directory by running command:

    cd C:\Users\username\AppData\Local\Android\sdk\tools\android\Sdk\tools\bin
    

    then run sdkmanager --licenses command, it asks to accept licenses.

    0 讨论(0)
  • 2020-11-22 17:33

    For those having issues with the command line SDK, the reason it won't find the licenses you have accepted is because they have have been written to a different location than $ANDROID_HOME/licenses which is where they need to be.

    I found the easiest solution was to accept the licenses like this:

    $ANDROID_HOME/bin/sdkmanager --licenses --sdk_root=$ANDROID_HOME

    Note: This assumes you've set ANDROID_HOME to point to wherever your sdk is installed.

    0 讨论(0)
  • 2020-11-22 17:34

    If you are using Jenkins, you can use the following bash script as first step in the build process:

    (while sleep 3; do echo "y"; done) | $ANDROID_HOME/tools/android update sdk -u
    

    This will of course install ALL available updates, but it will save you some time if you can spare the disk space. The sleep is to avoid the broken readline in the installation program, since "yes" does not work properly in this case.

    EDIT: You also need to add the "Install Android project prerequisites" plugin in the build step to get the correct $ANDROID_HOME if you are using the built in SDK manager.

    0 讨论(0)
提交回复
热议问题