Let's say in our project we go back in Git to a previous app version with older Google Play Services in build.gradle file and we have newer versions of Google Play Services SDK installed on our computers. So in that case, compiling either fails or succeeds but resulting app-crash in the first Google Play Services related operation.
For example the current crash message I am dealing with is starts like that:
java.lang.NoSuchMethodError: No static method zzax(Z)V in class Lcom/google/android/gms/common/internal/c; or its super classes (declaration of 'com.google.android.gms.common.internal.c'
and it points to this line:
GoogleAnalytics analytics = GoogleAnalytics.getInstance(context);
My question is, how one can compile an Android app with older Google Play Services dependencies while using newer SDK in it's computer?
Note: I believe downgrading the SDK is not an option because the SDK manager doesn't show the obsolete version (while it does show for other components).
Thanks for your help.