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

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

    In my case, the Enviroument Variable ANDROID_HOME was pointed to wrong (old) directory. I reallocated to correct one. In my case

    ANDROID_HOME=F:\Program Files (x86)\Android\android-sdk

    0 讨论(0)
  • 2020-11-28 05:52

    FOR WINDOW: I have faced this type of issue. But after exploring it solved in my case. I am using window 10. just follow few steps below:

    1. download Android SKD Manager for windows. https://developer.android.com/studio at the end of this page. It is zip file. after extracting it will show tools directory.

    2. Go to drive C:\ create new folder 'android-sdk'. copy tools folder and past in
      C:\android-sdk

    3. open command prompt as Administrator. Go to cd " c:\android-sdk\tools\bin ". sdkmanager will be show here. type skdmanager, it will show like this [=======================================] 100% Computing updates...

    4. after that type "sdkmanager platform-tools" it will create platform-tools directory in C:\android-sdk

    5. Now set System environment variables: right click on PC select properties. system settings will popup. click on > Environment Variables. Environment Variables will popup.

    6. At this window System variables as like this. C:\android-sdk\platform-tools and C:\android-sdk\tools\bin

    7. run command to build tools sdkmanager "build-tools;27.0.3"

      Also make sure java path is defined. I hope it will solve problem.

    0 讨论(0)
  • 2020-11-28 05:52

    Go to D:Android sdk\Android SDK and click on SDK Manager and check whether Build Tools are installed or not if they are not installed then install those tools

    0 讨论(0)
  • 2020-11-28 05:54

    You are missing android SDK tools. Please try the following:

    android list sdk --all
    android update sdk -u -a -t <package no.>
    

    Where <package no.> is 1,2,3,n and

    -u (--no-ui)  # Headless mode
    -a (--all)    # Includes all packages (also obsolete ones)
    -t (--filter) # Filter by package index
    
    0 讨论(0)
  • 2020-11-28 05:54

    Well Many people give their answer, some answer is same, some answer id different. I try many answer but they are did not work for me, of course I try from above answer also but did not solve my issue. And I don't know why but I have the same error even my issue solved by this ANSWER. I just want to write it might be helpful for someone.

    0 讨论(0)
  • 2020-11-28 05:54

    I have solved this issue by following steps:

    1. Go to cordova.gradle file (platform/android/cordovaLib/cordova.gradle)
    2. Search for getAndroidSdkDir() method
    3. Now simply replace System.getenv("ANDROID_HOME") with your real Android SDK path
    0 讨论(0)
提交回复
热议问题