在 Android SDK 中找不到 gradle 包装器.可能需要更新您的 Android SDK [英] Could not find gradle wrapper within Android SDK. Might need to update your Android SDK

查看:42
本文介绍了在 Android SDK 中找不到 gradle 包装器.可能需要更新您的 Android SDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建一个 ionic2 应用程序.我在运行 ionic build android 时遇到此错误.错误日志是

I am trying to take build in an ionic2 application. I got this error while running ionic build android. The error log is

ANDROID_HOME=/home/varun/Android/Sdk
JAVA_HOME=/usr/lib/jvm/java-8-oracle
Error: Could not find gradle wrapper within Android SDK. Might need to    update your Android SDK.
Looked here: /home/varun/Android/Sdk/tools/templates/gradle/wrapper

我尝试更新 sdk,但发现 sdk 版本是最新的.

I tried updating the sdk but it was found that the sdk version is latest.

当我查看 Android/Sdk/tools 文件夹时,没有 templates 目录.我在 ubuntu 16.04 上运行,cordova 版本 6.5.0

When i looked at the Android/Sdk/tools folder there is no templates directory. I am running on ubuntu 16.04, with cordova version 6.5.0

推荐答案

Cordova Android 的更新版本也修复了 SDK 工具 26.x.x 的一些问题

There has been a newer release of Cordova Android that also fixes some problems with SDK tools 26.x.x

cordova 平台更新 android@6.2.2

cordova platform rm android
cordova platform add android@6.2.2

旧答案

Google 通过最新的 sdk 工具更新破坏了 Cordova Android 6.1.x 和其他一些框架.

Google broke Cordova Android 6.1.x and some other frameworks with their latest sdk tools update.

Cordova Android 6.2.1 已经发布,现在兼容最新的 Android SDK.

Cordova Android 6.2.1 has been released and it's now compatible with latest Android SDK.

您可以使用 cordova platform update android@6.2.1

或者您可以删除现有平台并添加新平台(将删除您在 Project/platforms/android/文件夹中所做的任何手动更改)

Or you can remove the existing platform and add the new one (will delete any manual change you did inside yourProject/platforms/android/ folder)

cordova 平台 rm androidcordova 平台添加 android@6.2.1

您必须指定版本,因为当前的 CLI 默认安装 6.1.x.

You have to specify the version because current CLI installs 6.1.x by default.

这篇关于在 Android SDK 中找不到 gradle 包装器.可能需要更新您的 Android SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆