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\'
I just ran into this with another developer who had checked out my project, and then started getting build errors shortly thereafter. When I looked, my support library versions had appeared to have been updated as well.
Turns out this was happening after they had added a new Activity via the Android Studio add an activity wizard. This was automatically updating the build.gradle file to use the latest support library versions, and also adding the 'com.android.support:design:23.2.0' library as well which I wasn't even using.
I'm wondering if something similar is happening to you, as you are indicating it seems to be periodically happening.
Android Studio doesn't update the dependencies if you specify the 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.
If you the +
in your dependencies gradle updates with the latest version according to the build.gradle
.
For example:
compile 'com.android.support:support-v4:22.2.+'
compile 'com.android.support:support-v4:22.+'
compile 'com.android.support:support-v4:+'
It is a good practice to avoid it.
Instead of:
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'
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 the '
s with "
s.