Android Studio 'Obsolete Gradle Dependency' inspection issue - android

I have following gradle dependencies in my Android build.gradle file.
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
Declared versions are the current latest stable versions of these libraries(android support library). But Android Studio displays following warning on them.
A newer version of exists than 23.2.1 is available:
24.0.0-alpha1
24.0.0-alpha1 seems to be the newly released developer preview and I don't want to take them as a stable version of libraries. I can suppress or disable this inspection and get rid of the warnings. But doing so will avoid valid future warnings as well.
How can git rid of this warning for the developer previews?. The warning should appear only if valid new stable version of the library exists.
I use Android studio 1.5.1Thanks in advance

Guys from Google has already fixed it, so all that you need to do now is to wait for the next update.
This problem has already been reported here:
https://code.google.com/p/android/issues/detail?id=203321

Related

Android studio automatically tries to update libraries?

In my project I have many libraries defined in dependencies section in gradle. Problem is once in a while (once/twice a day)Android Studio gives me errors like this when opening the project or trying to get a release output:
Error:Unable to resolve dependency for ':TMessagesProj#armv7Debug/compileClasspath': Could not resolve com.google.android.gms:play-services-gcm:11.2.+.
My guess is it is because build tools is trying to check if there is an update for each library and when it doesn't find an Internet connection, it shows this error. If so, how can I change the setting in a way it doesn't have to check for updates? In other words in my project I don't need to update my libraries.
I know there is an offline mode that will probably do the trick! But I don't want to use this feature because it will probably disable some other useful features too. I just want to prevent it from automatically checking for library updates(If that's the problem shown above).
I included some part of my dependencies in gradle here:
dependencies {
compile 'com.google.android.gms:play-services-gcm:11.2.+'
compile 'com.google.android.gms:play-services-maps:11.2.+'
compile 'com.google.android.gms:play-services-vision:11.2.+'
compile 'com.google.android.gms:play-services-wallet:11.2.+'
}
Dependencies with a plus like 11.2.+' will always lead to repeated builds.
You have to specify the full version like:
com.google.android.gms:play-services-gcm:11.2.0
If you do not specify gradle will always be building because its looking for the latest version online of 11.2.+ may be 11.2.4, 11.2.6 etc

How does Gradle choose between more than 1 versions of the same library in a gradle tree?

Let say I have added Facebook and Twitter dependencies in my app.
com.facebook.android:facebook-android-sdk:4.22.1
com.twitter.sdk.android:twitter:2.1.0
When i look at Gradle tree, They come up with bunch of other transitive dependencies.
Now If Facebook uses com.android.support:support-annotations:24.1.1 and twitter uses com.android.support:support-annotations:25.0.3
Then which version gradle will use.
In gradle tree, It shows -> in front of older version of dependency. I learnt that this means gradle will use the newer version, and will not use the older version.
But this can be a problem, because some libraries are meant to run on the specific versions, and i have faced this problem.
In one of article i found out how npm manages these dependencies conflicts, but i am still unsure how gradle will manage between different version of same library.
You can't have different versions of the same library inside an apk.
As you mentioned, by default, Gradle puts the newest one to the build. If you want to specify a concrete version of the library that should be used in your project, you can add a direct compile (or implementation / api for Android Gradle Plugin v3+) statement with a required version to get one.
Also, you can force version using a special syntax, but it can lead to some problems later. You can find more information about version conflicts resolution in this post

Facebook Audience Network doesn't resolve

I have the facebook audience network dependency in my list of dependencies. It used to work, but it stopped resolving for no discernible reason.
compile 'com.facebook.android:audience-network-sdk:4.+'
I'm not in offline mode.
EDIT:
Changing the build variant gives a more descriptive error message.
I have a feeling they've pulled that version. For now fall back on the previous version:
compile 'com.facebook.android:audience-network-sdk:4.13.0'
There was a problem with the POM file. Version 4.14.1 has been deployed with the fix. So you can now go ahead and use the latest version via gradle. Specifying 4.+ will automatically use the 4.14.1 version.

different version number gradle file

My compiledsdkversion is 23. My Android support library has a 24.0.0-alpha1designation at the end of the string which declares it on my gradle app file. Gradle is compiling with errors stating that the support library should not use a different version than the compiledsdkversion.Any ideas on how to get rid of this error. I don't know how to update the compiledsdkversion.
You should use the latest stable version of the Support Library, which is currently 23.2.1 as per the release notes.

Android Studio always load old revision of support library

When I write code in Android Studio with some features from android support library it is ok, but when I try to build application, it cannot recognize some methods from support library. In "External library" I see that there is android-support-library revision 7, but in gradle file I wrote
compile 'com.android.support:support-v4:20.+'
I can't figure out what's the problem? and how can i solve it, could you please help me?
Just don't use the + sign:
compile 'com.android.support:support-v4:20.0.0'
So you can choose any fixed version number.
However the newest version was on Friday 21.0.2. I didn't check it in the meantime.

Categories

Resources