简体   繁体   English

有没有办法告诉Android始终采用最新的gradle插件?

[英]Is there a way to tell android to always take the latest gradle plugin?

In my gradle.build , generated for me by Eclipse, I had 在我的Eclipse为我生成的gradle.build ,我有

dependencies {
        classpath 'com.android.tools.build:gradle:0.4'
 }

Now there was a serious issue with the 0.4 version ( https://groups.google.com/forum/#!msg/adt-dev/_pB-fsNZapM/Ogcamgw-X9wJ ) so I had to change gradle.build to use 0.4.2 where it has been fixed: 现在0.4版本存在严重问题( https://groups.google.com/forum/#!msg/adt-dev/_pB-fsNZapM/Ogcamgw-X9wJ ),所以我不得不将gradle.build更改为使用0.4.2已修复的位置:

dependencies {
        classpath 'com.android.tools.build:gradle:0.4.2'
 }

Is there a way, though, to tell in the gradle.build to always pick up the latest possible android gradle plugin version? 但是,有没有办法告诉gradle.build始终选择最新的Android gradle插件版本?

I think that you can use ranges as it is supported by modern ivy versions . 我认为您可以使用现代常春藤版本支持的范围。

Using latest.release instead of a fixed version should do in your case. 在这种情况下,应该使用latest.release而不是固定版本。

Instead of a version number you can supply a +. 除了版本号,您还可以提供+。 It works as a wildcard. 它用作通配符。

classpath 'com.android.tools.build:gradle:0.4.+' classpath'com.android.tools.build:gradle:0.4.+'

will take the latest until 0.5.0 comes out. 直到0.5.0出来。

classpath 'com.android.tools.build:gradle:0.+' classpath'com.android.tools.build:gradle:0.+'

will take the latest until 1.0.0 comes out. 将采用最新版本,直到1.0.0发布。

classpath 'com.android.tools.build:gradle:+' classpath'com.android.tools.build:gradle:+'

will always take the latest. 将始终采用最新版本。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 升级到最新的 Android Gradle 插件 AndoidX 后出现 Gradle 错误 - Gradle error after upgrading to AndoidX the latest Android Gradle Plugin 有没有办法告诉Gradle始终在缓存中搜索然后在线搜索? - Is there a way to tell Gradle to always search in cache and then search online? 有没有办法告诉 gradle 总是使用 aapt2 的自定义二进制文件? - Is there a way to tell gradle always to use a custom binary of aapt2? Android-是否有办法告诉您后退按钮将带您进入哪个Intent? - Android - is there a way to tell which Intent the back button will take you to? Android Gradle - SonarCloud 与 Jacoco 插件集成,覆盖率始终为 0.0% - Android Gradle - SonarCloud Integration with Jacoco Plugin, coverage is always 0.0% Android和Fabric(Crashlytics)插件总是生成一个UUID(Gradle Kotlin DSL) - Android and the Fabric (Crashlytics) plugin always generates a UUID (Gradle Kotlin DSL) Gradle sync失败:android gradle插件版本2.3.0-beta1太旧了,请更新到最新版本 - Gradle sync failed: The android gradle plugin version 2.3.0-beta1 is too old, please update to the latest version 最新的 Android Studio - 将 Google Service Gradle 插件添加到 build.gradle 文件时出现问题 - Latest Android Studio - Problem adding Google Service Gradle plugin to build.gradle file 在哪里可以找到适用于最新版 Android Studio 的金丝雀版本的 android gradle 插件? - Where do I find android gradle plugin for the latest canary build of Android Studio? Gradle 始终下载最新版本的依赖项 - Gradle always downloads dependencies with latest version
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM