android - Android studio-Gradle版本为2.14.1。当前版本是2.10

标签 android gradle android-gradle-plugin

我无法在Mac中构建项目。这是别人给我编码的。我确实按照建议更改了gradle-wrapper.properties,但仍然面临问题

Error:(1, 1) A problem occurred evaluating project ':app'.
 Failed to apply plugin [id 'com.android.application'] Minimum supported Gradle version is 2.14.1. Current version is 2.10. 
 If using the gradle wrapper, try editing the distributionUrl in /Users/*****/Downloads/android_project/gradle/wrapper/gradle-wrapper.properties to gradle-2.14.1-all.zip. 

下面是我的gradle-wrapper.properties文件
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.0-all.zip

Gradle同步输出也显示了我无法解决的错误-不确定是否与上述有关
Error:(30, 13) Failed to resolve:   
com.android.support.constraint:constraint-layout:1.0.0-alpha4
<a href="install.m2.repo">Install Repository and sync project</a><br><a    
  href="openFile:/Users/*****/Downloads/android_project/app/build.gradle">
Show in File</a><br><a href="open.dependency.in.project.structure">
Show in Project Structure dialog</a>

最佳答案

您正在使用本地gradle分发。改变那去

Android Studio -> File -> Settings -> Build, Execution, Deployment -> Gradle -> Use default gradle wrapper

然后,您将使用gradle-wrapper.properties,它实际上应指向最新版本。

你可以看到他们here at gradle distributions

关于android - Android studio-Gradle版本为2.14.1。当前版本是2.10,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40426213/

相关文章:

android - 如何使用 android 布局中的工具替换设计器的合并项

android - Eclipse 停止编译 RenderScript 文件

java - 方法执行完成后本地字节缓冲区是否被清空?

android - Android:使用不同的资源集构建项目

java - jdk 安装时构建 Gradle 错误?

android 手机和平板布局

android - 具有 gradle 和 android 的不同 API 主机

android - 可在多个 MPP 中重用的 Kotlin 公共(public)库

android - 将项目迁移到新的实验性 gradle 插件

android - 为什么需要 gradle build packagingOptions?