Ionic build error : You have not accepted the license agreements of the following SDK components: [Android SDK Platform 24]

后端 未结 18 1612
挽巷
挽巷 2020-12-08 18:59

I\'m trying to run the command ionic build android --release to build the apk but i am getting this error

Total time: 1.767 secs Error:

相关标签:
18条回答
  • 2020-12-08 19:18

    I solved it by installing the Android SDK Platform 24 without the Android SDK manager.

    android update sdk --no-ui --filter build-tools-24.0.2,android-24,extra-android-m2repository
    

    *Cordova CLI 6.4.0 / Windows 10

    0 讨论(0)
  • 2020-12-08 19:20

    Above peter wang's answer worked for me after setting the ANDROID_HOME environment variable. in my case ANDROID_HOME was C:\Users\YourUserName\AppData\Local\Android\android-sdk

    After that below commands resulted in a successful build.

    mkdir "%ANDROID_HOME%\licenses"
    echo |set /p="8933bad161af4178b1185d1a37fbf41ea5269c55" > "%ANDROID_HOME%\licenses\android-sdk-license"
    
    0 讨论(0)
  • 2020-12-08 19:22

    I solved the problem by checking file android-sdk-licenses in Installed ANdroid path for ex my path G:\Android\sdk\licenses with the same file present in this directory C:\Users\Ashutosh\AppData\Local\Android\Sdk\licenses copy all the licenses if more than one :)

    0 讨论(0)
  • 2020-12-08 19:23

    You will run into an issue like this whenever your Android Studio's packages are outdated, as building will occur in the latest stable releases. To fix, do the following:

    Android Studio > Preferences > Appearance & Behavior > System Settings > Android SDK Tick the latest Android versions (or what you need), click Apply. It's at this point where Android will ask you to agree to its license(s) and the updated version(s) will be installed.

    Now you can Ionic / Cordova / PhoneGap build / run.

    0 讨论(0)
  • 2020-12-08 19:26

    In Command Prompt, go to ANDROID_HOME\tools\bin

    Then run the command, sdkmanager --licenses

    Accept the licenses you want when it is prompted.

    0 讨论(0)
  • 2020-12-08 19:26
    1. Go to C:\Users\<UserName>\AppData\Local\Android\Sdk\tools\bin
    2. Run command ./sdkmanager.bat --licenses
    3. accept license

    Worked for me

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