简体   繁体   English

如何知道gradlescript使用哪个版本来构建android应用

[英]How to know which version gradlescript is using to build android app

I am using below line to build android support libraries: 我正在使用以下代码来构建android支持库:

compile "com.android.support:appcompat-v7:26.+"

This line is getting built correctly in Android Studio 该行在Android Studio中正确构建

I have found current releases for support libraries and they are 26.0.0,26.0.1,26.0.2 & 26.1.0 when I am specifying as below gradle script is not getting build. 我发现支持库的当前版本是26.0.0、26.0.1、26.0.2和26.1.0,当我在下面指定gradle脚本未建立时。

compile "com.android.support:appcompat-v7:26.0.0"
compile "com.android.support:appcompat-v7:26.0.1" 

etc, so if I have specified as: 等等,所以如果我指定为:

compile "com.android.support:appcompat-v7:26.+"

Then how to know which version of 26.+ the gradlescript is using for building the current app? 然后如何知道gradlescript使用哪个版本的26. +构建当前应用程序?

如果您使用+指定dependencyversion ,则android studio将自动采用该dependencynewest版本

There is an easy way to know the version. 有一个简单的方法可以知道版本。

  • command + O : search a class such as SwitchCompact or RecyclerView command + O :搜索诸如SwitchCompactRecyclerView类的类
  • Then click the button 然后点击按钮 在此处输入图片说明
  • Finally you will see 最后你会看到

    在此处输入图片说明

By changing Android->Project view(in dropdown list) in Project explorer we can get External Libraries section at bottom there we can find exactly which version is used by gradescript. 通过在Project Explorer中更改Android-> Project视图(在下拉列表中),我们可以在底部找到“外部库”部分,我们可以确切地找到gradescript使用的版本。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM