如何获取最新版本的Android ConstraintLayout?

50

当我在我的布局content_main.xml中尝试使用 ConstraintLayout 时,我会收到以下消息:

正在使用已过时的约束库版本1.0.0-alpha5

我目前正在使用以下库依赖项:

compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha5'

我该如何获取ConstraintLayout的最新版本号?


1
ConstraintLayout alpha 8现已发布。请访问http://tools.android.com/recent 以获取更多信息。 - pskink
1
请访问以下链接,您可以找到所有最近的ConstraintLayout版本:http://tools.android.com/system/app/pages/search?scope=search-site&q=ConstraintLayout - Nishant Pardamwar
现在发布的列表在这里列出:https://androidstudio.googleblog.com/search?q=constraint - arekolek
有新版本可用:1.1.3。 - Islam Nabil
我不会使用对alpha的引用。因为它们已知会删除那些引用。 - John Lord
4个回答

80

29

2
甚至有一个新版本:1.0.1 - R. Zagórski
2
新版本是 1.0.2 - Abhishek Singh
最新版本是 ConstraintLayout 1.1.0 beta 1。 - Lalit Fauzdar
谢谢,Lalit,一旦它成为生产版本,我们会进行更新。 - Simon K. Gerges

2

1

如何直接使用ConstraintLayout

请查看Maven仓库获取最新版本。请使用完整的版本名称(例如2.0.0-beta2)。

将依赖项添加到目标模块:

target_module/build.gradle

如果使用支持包:
android {
  ...
}

dependencies {
  ...
  implementation `com.android.support.constraint:constraint-layout:some-version-number`
}

如果使用androidx包:
android {
  ...
}

dependencies {
 implementation 'androidx.constraintlayout:constraintlayout:some-version-number'
}

可以在官方发布公告中找到关于2.0.0-alpha5的确切Gradle代码行。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接