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'
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.
Replace the version number with only "+" sign.
Sync gradle
Now select + sign and press ALT + ENTER, it will show you drop down menu with an option to select latest version.
If you have added a dependency, you can see them by moving the cursor to that library. It will show you a warning
You can then change to new library and sync your project.
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.
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:
You can even do a search for a specific library, and then expand/collapse as desired:
Related
Setting the right versions for Gradle dependencies has always seemed, to me, to be an arcane science. For instance take the following line . . .
implementation 'com.firebaseui:firebase-ui:+'
If I build the project with that line I get version 12.0.1 which should be the latest version. No?
If I place my cursor on the + and hit alt-enter and choose "Replace with specific version" I get version 2.1.0. I recall reading somewhere that I should get the latest version stated specifically instead of, in this case, 2.1.0.
So I guess the most dependable way to find the latest version of a library is to compile with + and look to see what I get.
When there is an update android studio show a warning and a mouse over is enough to show you the latest library.
This works great for all google-android components.
For other third party libraries I usually add a link comment in order to check regularly if there is something new.
Note that in the white theme the warnings are not so clear as in the black theme.
When I am setting up gradle, I have to add something like:
compile 'com.google.android.gms:play-services:6.1+'
I don't like to use the +, so I can always know which version the project is being compiled with and so I can avoid some surprise bugs.
In order to find the Google Play version I have currently downloaded, I usually go to the library XML file which I can find something like: "6171000", which is the version as an integer.
Is it there a simpler way to figure out the version that I need to write on gradle?
cd into your module (eg: app) dir, and run gradle command line ..\gradlew -q dependencies --configuration compile. This will resolve the + , and show you exact version being used for your library. See below.
Or, if you use Android Studio, when you modify/edit the version (eg: simply delete/add + at the end), Android Studio will show a yellow-bulb action with Replace with specific version, click on it to automatically replace the + with exact version available.
Go to this site: http://gradleplease.appspot.com/#play-services
You can also search for any library (Ex. recyclerview). This will help you specify the library's latest version.
I have a project target to API Level 10 and i want to implement the new ActionBar support library.
After follow all the instrutions in the Support Library Setup, when adding the library to my project I came across with dozens of error messages like this:
android-support-v7-appcompat\res\values-v14\styles_base.xml:24: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.....
OK, i know that they are many answers to this question, but, after trying all the more obvious, i still could not solve the error.
I kept searching and found the cause, which is not so obvious, at least for newbies like me.
My intent is provide a full answer to help all those who are like me and do not master all the secrets of the Android development.
This is what you have to do for use the ActionBar support library correctly.
Follow the instructions in the Support Library Setup - Adding libraries with resources.
One thing that can bring some doubt is add the library to your aplicattion project:
(1) In the Project Explorer, right-click your project and select Properties.
(2) At the left pane select Android.
(3) At th bottom of the right pane click Add
(4) Select the library project android-support-v7-appcompat and click OK.
Click OK to close the properties window.
If you not get any of the errors I mentioned it´s all done.
However if you are like me, you dont´t followed the advice of Android team that suggests you always compile your source using the latest SDK, you get the error.
The error ocurrs because my Project Build Target was Android 2.3.3 and need to be at lest 3.0.
It was not immediately clear to me because of the fact that I'm specifically developing for Android 2.3.3 and I'm using support libraries.
OK, I hope this helps.
You should add that support library to your project. To add:
Right click on project, then go to :
properties > Java Build Path > Libraries
here Add External JARs...
add android-support-v7-appcompat.jar (path/to/sdk/extras\android\support\v7\appcompat\libs)
Additionally you also have to copy that jar to libs folder of your project, if it is not there automatically.
and you should use the #style/Theme.AppCompat theme for your application for support-v7 to be working
also keep one thing in mind you should change min sdk version to 11 if you want to support("android:windowActionBar")property in your project.
My app crashes when I try to use libraries (like Google Analytics or others).
I've searched on Google and found some help but it still doesn't work...
My lib folder is called "libs", I've got jar in the build path...
Have you got any ideas?
The error is :
java.lang.NoClassDefFoundError: com.google.analytics.tracking.android.EasyTracker
EDIT :
Here my conf :
Thanks.
If you're using Eclipse, try this
Select your Project with the Mouse
Right click->Properties
Select Android
Verify that you've selected the "Google APIs" version that you need for your project
At the bottom, your Libraries should also appear. If they don't
Click the Add button. Add the missing libraries. Careful, though, your libraries need to use compatible APIs to your main project.
I am using combination of Maven and IntelliJ Idea.
Although javadoc and sources are shown using Android Module in Idea, I can not see any of them using Android maven.
Any help, how to show sources also with Maven in Idea? Should I set it in pom.xml or somewhere in Idea preferences?
Please check the related issue for the workaround:
manually attach the sources to "Maven: com.google.android..." project library
See the Module Dependencies for details how to do it.
First of all make sure you downloaded the sources from the Android SDK for the target that you are using in your project.
Now in IntelliJ, under Project Structure (CMD+;) => Modules => Dependencies you should be seeing "Maven: com.google.android:android:4.1.1.4" and also "Android X.X Platform (java version... )". Select the "Android X.X" and press the up arrow at the bottom to move it up so it's at the top.
Now you should be running with the SDK module which include the sources