ionic build android (或cordova build android)报错:Error: Could not find an installed version of Gradle

执行ionic build android (或cordova build android)打包时报错的解决方案

错误如下:

Error: Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio
  • 1
  • 2
  • 3

解决方案:

  • 1、手动下载gradle

gradle-x.x-bin.zip (x.x代表版本) 
根据需要下载某一版本 
地址: 
(https://services.gradle.org/distributions)

  • 2、添加环境变量
    PATH=C:\Program Files\gradle-x.x\bin
  • 1
  • 3、关闭cmd或powershell窗口
  • 4、重新打开,输入gradle -v,查看gradle安装成功与否
  • 5、重新build

猜你喜欢

转载自blog.csdn.net/zhangqun23/article/details/80105923
今日推荐