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

后端 未结 27 3567
被撕碎了的回忆
被撕碎了的回忆 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 05:51

    Open Command Prompt Check for ANDROID_HOME path using SET ANDROID_HOME, if not set then set using below command.

     SET ANDROID_HOME="C:\Users\VenkateshMogili\AppData\Local\Android\Sdk"
    

    OR open system environment variables and create new variable as

     Variable Name: ANDROID_HOME
     Variable Value: C:\Users\VenkateshMogili\AppData\Local\Android\Sdk
    

    and open cordova.gradle file (/platforms/android/CordovaLib/cordova.gradle) and search for getAndroidSdkDir() method and Replace the ANDROID_HOME path ("C:/Users/VenkateshMogili/AppData/Local/Android/Sdk") instead of System.getenv("ANDROID_HOME")

    If license problem arises then type below command by opening the command prompt in C:\Users\VenkateshMogili\AppData\Local\Android\Sdk\tools\bin

      sdkmanager "build-tools;27.0.3"  //<-that will create build-tools folder and licenses folder.
    

    It works for me.

提交回复
热议问题