ionic Android : A problem occurred configuring project ':CordovaLib'. > You have not accepted the license agreements of the following SDK components: [Android SDK Build-Tools 26.0.2].


        Today i've using ionic again with Terminal command line on macOS Sierra, after try create new project and using this command `sudo ionic cordova build android` the problem occurs after take a time to search, it's having many cause of this issue, my ionic try to hook this `Android SDK Build-Tools 26.0.2`
        1. Base of this issue is `wrong sdk path` or `missing sdk build tools version`, don't quit Terminal if your build fail. Take a look into this area.

> cordova build android
Android Studio project detected

ANDROID_HOME=/Applications/adt-bundle-mac-x86_64-20140702/sdk

JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
studio

Subproject Path: CordovaLib

        2. Check at the line of ANDROID_HOME and open Android Studio then goto SDK Manager and click tab SDK Tools, first see at Android SDK Location is match or not?, second check box Show Package Details and take a look build tool version that needed ready installed or not?, if not just install, then it must pass process `accepted the license agreements` by your check box accept license.



        3. this is my case, i've installed Eclipse ADT and Android Studio, so i've both Android SDK two location, let's open Eclipse ADT then goto Android SDK Manager and take a look at Android SDK Build-Tools version we needed, DON'T install build tools for Eclipse ADT (Official Android not support Eclipse ADT anymore).


From this point check 3 step.
1. Android Studio with Build-Tools is 26.0.2  [correct] 
Android SDK path=/Users/poraweeraksasin/AndroidSDK

2. Eclipse ADT with Build-Tools is 25.2.5 [incorrect]
Android SDK path=/Applications/adt-bundle-mac-x86_64-20140702/sdk

3. ANDROID_HOME=/Applications/adt-bundle-mac-x86_64-20140702/sdk using `2.` [incorrect]

        I must update system ANDROID_HOME path to Android Studio, let's quit current Terminal with failed compile and open new one. Then from default prompt on Terminal type `sudo nano -e .bash_profile` and enter then type your machine password and enter. Comment out the line that contain path to incorrect sdk path by adding `#` before first character of that line. 


#export ANDROID_SDK="/Applications/adt-bundle-mac-x86_64-20140702/sdk"
export ANDROID_SDK="/Users/poraweeraksasin/AndroidSDK"
export PATH=$PATH:$ANDROID_SDK

        Check whole of this file no matter what `ANDROID_HOME` `ANDROID_SDK` `ANDROID_SDK_ROOT` and update like above refer to your path, then save this file by `ctrl+x` and `Enter`. Quit all Terminal, reopen and follow step to proceed `sudo ionic cordova build android` command again. Your compile should be BUILD SUCCESSFUL.

Comments

  1. As the outcome, you will have the capacity to build up your discernment and focus. Since amusements are fun and fascinating, you won't feel like you are constraining your cerebrum to do this! pokemesh

    ReplyDelete

Post a Comment