简体   繁体   中英

Can't target downloaded Android build tools tools

I've downloaded Android SDK ( Get just the command line tools for Windows) and unpacked them to C:\\ProgramData\\AndroidSdk . Then I added C:\\ProgramData\\AndroidSdk and C:\\ProgramData\\AndroidSdk\\bin to the PATH environmental variable. I also added ANDROID_HOME variable and set it to C:\\ProgramData\\AndroidSdk .

When I execute cordova build android I get the following error message.

  • Where:
    Script 'C:\\Source\\Poc\\CordovaApplication01\\platforms\\android\\CordovaLib\\cordova.gradle' line: 68

  • What went wrong:
    A problem occurred evaluating project ':CordovaLib'.
    No installed build tools found. Install the Android build tools version 19.1.0 or higher.

By the error message I understand that the tools aren't found but I'm not sure what to do about it. When I remove the added parts of PATH I get other errors (the same goes for ANDROID_HOME ) so I'm assuming that those are set correctly.

How can I do better diagnostic now? I'm new to Android platform so it might be something fairly simple that I'm missing.

(I've added the platform Android and tried to follow the steps of every guide I've found. Some mention a directory called tools and Platform-tools but those aren't present in the downloaded ZIP file and I've been told that the since the angular command is deprecated, the structure of the ZIP might have changed.)

Check the installed version of SDK build tools

sdkmanager --list

My example found build-tools;27.0.3

Then replace defaultBuildToolsVersion value on platforms\\android\\build.gradle with installed SDK build tools version In my example defaultBuildToolsVersion=27.0.3

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM