Keith Sheppard
Keith Sheppard

Reputation: 49

How to determine correct version of constraint-layout

My gradle contains the line

implementation 'com.android.support.constraint:constraint-layout:+'

This works, but I get a warning message telling me I should avoid using + in version numbers. That's all very well but how should I determine what to number to use instead of +?

This line was auto-generated when I created the project several Android Studio versions ago.

Other lines from the gradle file that may, or may not, be relevant:

compileSdkVersion 28
buildToolsVersion "27.0.3"

Then later...

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation files('libs/jcifs-1.3.18.jar')
//    compile 'com.android.support.constraint:constraint-layout:+'
//  This used to be versions 27.1.1
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.google.android.gms:play-services-appindexing:8.4.0'
implementation 'com.android.support.constraint:constraint-layout:+'
testImplementation 'junit:junit:4.12'

Upvotes: 2

Views: 324

Answers (3)

Sumit Shukla
Sumit Shukla

Reputation: 4514

  • Update your sdk packages.
  • In Android Studio goto File->Project Structure->Dependencies.
  • Search relevant dependencies for usages with their updated version.
  • You can checkout Maven Repository for their respective versions for dependency.

Upvotes: 1

Keith Sheppard
Keith Sheppard

Reputation: 49

Many thanks to those who took the trouble to respond. I have just migrated my development environment to a new machine so, as far as I know, I have the latest versions of everything. I don't need any new features because my app is working fine with the current feature set.

Following Sumit's suggestion (thanks Sumit), I found the following information: "Gradle promoted library version from + to 2.0.0-beta2"

I therefore replaced the + in my gradle file with 2.0.0-beta2 and everything worked fine. I remain a little concerned that I am apparently using beta libraries in a released product but provided my testing doesn't reveal any bugs I am prepared to live with that.

Thanks again to all.

Upvotes: 0

ikerfah
ikerfah

Reputation: 2862

You have two options :

  1. Easy way , Use Maven Repository [ Direct link ] , And here you can see at the top by now 2.0.0-beta2 , so this is the latest version.
  2. Check android studio release updates This link -> Release Updates -> at the top of the list choose title that start with Android Studio -> in the left sidebar , choose the recent month and u can find there things like android studio , emulator and ConstraintLayout -> click on ConstraintLayout and you will get your latest version with the new features

Upvotes: 0

Related Questions