Build.gradle dependencies automatically updates itself

compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.android.support:support-v4:22.2.1'
compile 'com.android.support:design:22.2.1'

to

compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.android.support:support-v4:23.1.0'
compile 'com.android.support:design:23.1.0'

From time to time, android studio automatically changes the values ​​to the latest version, which is extremely annoying and interrupts my application. Is there any way to prevent this?

There was a google search and stackoverflow, but nothing appeared.

+4
source share
3 answers

Instead:

compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.android.support:support-v4:22.2.1'
compile 'com.android.support:design:22.2.1'

to try:

playVersion = '8.3.0'
supportVersion = 'support-v4:22.2.1'
designVersion = '22.2.1'
compile "com.google.android.gms:play-services:$playVersion"
compile "com.android.support:$supportVersion"
compile "com.android.support:design:$designVersion"

Remember to replace 'with "s.

+3
source

Android Studio does not update dependencies if you specify a version

Example:

compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.android.support:support-v4:22.2.1'
compile 'com.android.support:design:22.2.1'

In this case, AS will tell you when there is a newer version without updating them.

+ gradle build.gradle.
:

compile 'com.android.support:support-v4:22.2.+'
compile 'com.android.support:support-v4:22.+'
compile 'com.android.support:support-v4:+'

, .

0

, , . , , , .

It turns out that this happened after they added a new activity through Android Studio, adding an action wizard. This automatically updated the build.gradle file to use the latest versions of the support library, as well as adding the com.android.support:design:23.2.0 library that I didn’t even use.

I am wondering if something similar happens to you, since you indicate that this happens periodically.

0
source

Source: https://habr.com/ru/post/1622223/


All Articles