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

前端 未结 17 1173
野性不改
野性不改 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条回答
  • On Windows:

    1. Add USER Environment variables:

    NOTE: Path should be appended

    JAVA_HOME           %ProgramFiles%\Android\Android Studio\jre
    ANDROID_SDK_ROOT    %LocalAppData%\Android\Sdk
    Path                %LocalAppData%\Android\Sdk
    
    1. Run the below command to accept licenses:

    NOTE: Accept all licenses (say y)

    %ANDROID_SDK_ROOT%/tools/bin/sdkmanager.bat --licenses
    
    1. Now run your app:

    (like below, or another command that failed for you):

    cd \myapp\
    react-native run-android
    
    0 讨论(0)
  • 2020-12-02 08:43

    If you are working with Flutter then this command would definitely work for you.

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

    in Windows OS go to your sdkmanager path directory in cmd

    You can find your sdkmanager in C:\Users\USER\AppData\Local\Android\Sdk\tools\bin

    then execute the followwing command:

    sdkmanager --licenses

    after that it will ask to accept license agreement several times then accept all by just typing y on cmd

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

    On Mac OS 10.15.1, I got the same error even after accepted all the licenses by running sdkmanager --licenses It worked after I updated the ANDROID_HOME path configuration in the ~/.bash_profile to the following

    export ANDROID_HOME=/Users/your_username/Library/Android/sdk
    export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
    export PATH=$PATH:~/Library/Android/sdk/platform-tools
    

    And reload the ~/.bash_profile

    source ~/.bash_profile 
    
    0 讨论(0)
  • 2020-12-02 08:43

    I tried many solutions but didn't work for me. The below solution works for me.

    locate the sdkmanager file in android SDK.

    In my case : ~/Android/Sdk/tools/bin

    go to that path : cd ~/Android/Sdk/tools/bin

    Accept licenses manually : ./sdkmanager --licenses Enter Yes or y

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

    This works for me:

    yes | ./sdkmanager "platforms;android-28"

    yes | ./sdkmanager "build-tools;28.0.3"

    yes | ./sdkmanager --licenses

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