“Failed to install the following Android SDK packages as some licences have not been accepted” error

前端 未结 17 1172
野性不改
野性不改 2020-12-02 08:08

I am getting this error in jitpack, I\'ve tried everything on the internet. Below is my error

Failed to install the following Android SDK packages as some l         


        
相关标签:
17条回答
  • 2020-12-02 08:34

    You need to accept the licences before building.

    According to Android SDK docs you can use the following command depending on the sdkmanager location: Docs on --licenses option seems to be missing though.

    yes | sdkmanager --licenses
    

    GNU/Linux Distributions:

    yes | ~/Android/Sdk/tools/bin/sdkmanager --licenses
    

    macOS:

    export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home
    yes | ~/Library/Android/sdk/tools/bin/sdkmanager --licenses
    

    Windows:

    %ANDROID_HOME%/tools/bin/sdkmanager --licenses
    

    Flutter:

    > flutter doctor --android-licenses
    
    0 讨论(0)
  • 2020-12-02 08:36

    MacOS Catalina

    Step 1: Changing Android Studio Preference

    1. Open-up your Android Studio
    2. Press Command+, or go to top-left AppBar Android Studio > Preferences.
    3. From Left Pane, select Appearance > System Settings > Android SDK
    4. Select SDK Tools next to SDK Platforms and under Android SDK Location
    5. Check mark Android SDK Command-line Tools (latest) and Press OK button.
    6. Wait for installation to be finished

    Step 2 (For Flutter Users):

    1. Go to Terminal and run the following command

    flutter doctor --android-licenses

    Step 2 (For Android Users):

    1. Go to the Terminal and run the following command

    export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home

    yes | ~/Library/Android/sdk/tools/bin/sdkmanager --licenses

    0 讨论(0)
  • 2020-12-02 08:36

    If you are using flutter go with the following steps

    1.open the command prompt
    

    Then the following command

    2.C:\Users\niroshan>flutter doctor
    

    And you will see the issues as follows

    Doctor summary (to see all details, run flutter doctor -v):
    [√] Flutter (Channel stable, 1.22.2, on Microsoft Windows [Version 10.0.17763.1339], locale en-US)
    
    [!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
        X Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses
    [!] Android Studio (version 4.1.0)
        X Flutter plugin not installed; this adds Flutter specific functionality.
        X Dart plugin not installed; this adds Dart specific functionality.
    [√] VS Code (version 1.50.1)
    [!] Connected device
        ! No devices available
    
    ! Doctor found issues in 3 categories.
    

    Actually what you have to run is the below command

    C:\Users\niroshan>flutter doctor --android-licenses
    
    0 讨论(0)
  • 2020-12-02 08:39

    To add to the answers, you can also change to the sdkmanager directory and in a sub shell and accept the licenses there

    (
        cd /home/user/android-sdk-linux/tools/bin
        yes | ./sdkmanager --licenses
    )
    
    0 讨论(0)
  • 2020-12-02 08:41

    You can accept the license agreements of the stated SDKs by going to the SDK Manager (Settings > [Search for Android SDK]) then find the packages noted in the error message and find them there. Chances are, you'll find SDKs that are not fully installed and installing them will ask you to accept the license agreement.

    0 讨论(0)
  • 2020-12-02 08:41

    I just done File -> Invalidate caches and restart Then install missing packages. Worked for me.

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