Windows cordova build Error: Could not find gradle wrapper within Android SDK. Might need to update

问题说明

在Windows7上运行 “cordova build android” 报错,如下:

C:\test\hello> cordova build android
ANDROID_HOME=C:\Users\kongxx\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121
Error: Could not find gradle wrapper within Android SDK. Might need to update yo
ur Android SDK.
Looked here: C:\Users\kongxx\AppData\Local\Android\sdk\tools\templates\gradle\wr
apper

解决办法

  • 下载 Android SDK tools package(https://dl.google.com/android/repository/tools_r25.2.3-windows.zip)
  • 进入 C:\Users\AppData\Local\Android\sdk目录
  • 备份tools目录
  • 将压缩包中的tools目录解压到这个目录下
  • 进入工程目录,再次运行 “cordova build android”。

你可能感兴趣的:(Windows cordova build Error: Could not find gradle wrapper within Android SDK. Might need to update)