ionic build Android | error: No installed build tools found. Please install the Android build tools

后端 未结 27 3575
被撕碎了的回忆
被撕碎了的回忆 2020-11-28 05:25

When I run ionic build android command in root of ionic project, I am getting this error:

FAILURE: Build failed with an exception.

27条回答
  •  我在风中等你
    2020-11-28 06:05

    This is very irritating error and i wasted my almost 9 hours to solve this.
    
    Steps to solve:
    
    Notice **ANDROID_HOME** while you run **ionic cordova build android** . command i. for example in my case it was pointing to some other android sdk which i uninstalled and then it started pointing to right sdk.
    **In my case i uninstalled :**
    
    brew cask uninstall android-sdk
    brew cask uninstall android-platform-tool
    
    
    then i ran **ionic cordova build android**
    
    > cordova build android
    ANDROID_HOME=/Users/anand/Library/Android/sdk
    JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home
    
    
    Then it might say lineces not accepted then run below command :
    
    cd /Users/Android/sdk/tools/bin/
    then run ./sdkmanager --licenses
    accepts all with y option
    
    
    Then it might say unable to download jars then go to platform android and build.gradle
    
    and search for buildscript and inside that reverse the order 
    
    
    repositories {
            jcenter()
            maven {
                url "https://maven.google.com"
            }
        }
    
    Thats it . Enjoy huh
    

提交回复
热议问题