Android Studio : How to find latest version number of google specific libraries?
Asked Answered
S

4

8

How to find latest version number of google specific libraries from repositories (jcenter etc..) to include in gradle dependencies in Android Studio.

For non google libraries generally I can make a search in jcenter itself. But not able to search google specific libraries there.

You may take example of following libraries.

com.android.support:appcompat-v7:25.1.0'
com.android.support:recyclerview-v7:23.3.0' 
Shonda answered 12/1, 2017 at 10:18 Comment(7)
Gradle tells you by highlighting them as a warningRegenerator
ANDROID_SDK\extras then android\m2repository (for support libs) and google\m2repository (for google and firebase)... fx for play service it would be ANDROID_SDK\extras\google\m2repository\com\google\android\gms\play-services ... form me newest is 10.0.1Lordinwaiting
All these answers are hacky at best! There really should be a simple and guaranteed way to make this work. It's pretty important after all!Vang
@Lordinwaiting Thanks, this lets us choose earlier versions of libraries too, in case of compatibility issues with the latest versions. If you write this as an answer, I'll vote for it.Powwow
@Lordinwaiting Hmm.. I just noticed that the numbering in the maven repositories is different from the numbering we need to use in android studio? Latest version in maven are 10.x.y and 11.x.y but in android studio 16.x.y and 17.x.y ? (for play services)Powwow
The numbering of the libraries that Android Studio uses, can be found all listed at maven.google.com, as I just wrote in my answer below.Powwow
@Powwow are you thread necromancer? maven.google.com didn't exist in january 2017Lordinwaiting
R
9

Yes as Tim mentioned in the comment Gradle tells you by highlighting particular dependency as a warning.

Trick to update dependency with latest version:

Let me also share a trick through which you can always include the latest version of the particular dependency.

  1. Replace the version number with only "+" sign.
  2. Sync gradle
  3. Now select + sign and press ALT + ENTER, it will show you drop down menu with an option to select latest version.

enter image description here

Raynor answered 12/1, 2017 at 10:47 Comment(1)
Your solution sounds good in theory, but in practice hitting ALT + ENTER results in the program insisting that I type in a number (instead of filling in a number which it usually does). And that's the number I'm trying to find!Vang
G
1

If you have added a dependency, you can see them by moving the cursor to that library. It will show you a warning

like this

You can then change to new library and sync your project.

Griselgriselda answered 12/1, 2017 at 11:2 Comment(4)
I've noticed that recently I'm no longer getting these warnings to update. They still highlight that the sdk version could be updated, but nothing in the dependencies section.Mastodon
@Mastodon I am using Android Studio 3.0 which was released 3 days ago and it's still working the same way.Griselgriselda
@RakeshYadav I just got the notification to update to 3.0 (from 2.3.3) and it is working again!Mastodon
I don't know what was the issue. But it was working for me in 2.3.3 version as well. Whatever was the reason, happy to know that it helped you.Griselgriselda
W
1

Another way to use the latest libraries in Android Studio.

Right click your project and choose Open Module Settings. Project Structure window will appear. Select 'app' from the left pane and choose the 'Dependencies' tab. Include new library dependency by pressing the + icon. Search your needed library in the window opened up. Latest library dependency will appear in the suggestions and you can add them to your project.

Wherewithal answered 12/1, 2017 at 11:52 Comment(0)
P
1

The best way these days is to go to https://maven.google.com , where google now lets you browse all their libraries and see all the versions available, including the latest version. It looks like this:

enter image description here

You can even do a search for a specific library, and then expand/collapse as desired:

enter image description here

Powwow answered 11/4, 2020 at 9:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.