Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK - Android

在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 your Android SDK.

解决办法:

1.如果已经安装了Android Studio:

  • 复制templates目录:C:\Program Files\Android\Android Studio\plugins\android\lib\templates
  • 粘贴至如下目录:C:\Users\<user-name>\AppData\Local\Android\sdk\tools

2.没有安装Android Studio:

 

点赞