无法构建 android gradle 项目 - 用于cordova 项目 [英] Unable to build an android gradle project - for a cordova project
问题描述
我无法构建 gradle 项目,即使我编辑了 gradle 属性,我也会收到以下错误:
I am unable to build a gradle project, even if I edit the gradle property, I get the following error:
Error:(22, 1) A problem occurred evaluating root project 'android'.
> Failed to apply plugin [id 'android']
> Gradle version 2.10 is required. Current version is 2.2.1. If using the gradle wrapper, try editing the distributionUrl in C:\Users\salangar\angular-cordova-tickrv0.1\platforms\android\gradle\wrapper\gradle-wrapper.properties to gradle-2.10-all.zip
我该如何解决这个问题?
How do I resolve this?
推荐答案
我也遇到同样的错误并修改了
$(你的应用路径)/platform/android/gradle/wrapper/gradle-wrapper.properties 到
I was also getting the same error and modifying the
$(your app path)/platform/android/gradle/wrapper/gradle-wrapper.properties to
distributionUrl=http\://services.gradle.org/distributions/gradle-2.10-all.zip
没有帮助,因为每次我运行cordova build android到2.2.1时它都会被覆盖
didn't help as it was getting overridden every time i ran cordova build android to 2.2.1
我终于改变了 $(your app path)/platforms/android/cordova/lib/builders 文件夹下的 gradleBuilder.js 文件.
I finally changed the gradleBuilder.js file under $(your app path)/platforms/android/cordova/lib/builders folder.
搜索 distributionUrl 并将其更改为 2.10.
Search for distributionUrl and change it 2.10.
这触发了gradle-2.10的下载和编译通过.至少它对我有用.
This triggered download of gradle-2.10 and compilation went through. At least it worked for me.
这篇关于无法构建 android gradle 项目 - 用于cordova 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!