0

I am using these dependencies and am unable to decrease the API level from 14 to 13 or lower:

dependencies {
    compile ('com.google.android.gms:play-services:+')
    compile files('libs/dagger-1.2.2.jar')
    compile files('libs/javax.inject-1.jar')
    compile files('libs/nineoldandroids-2.4.0.jar')
    compile files('libs/support-v4-19.0.1.jar')
    compile 'com.android.support:multidex:1.0.1'

How do you increase the API level in Android when using compile ('com.google.android.gms:play-services:+')?

Oussema Aroua
  • 5,225
  • 1
  • 24
  • 44
  • 2
    The lower allowed API is the highest of all your dependencies. If you have a library that need API 14 you won't be able to set your minimum API as 13. Check the requirements of your libs – Alberto S. Aug 04 '17 at 11:32
  • The first thing that you should do is replace the `+` with an actual version number. The version of Play Services will determine what `minSdkVersion` it requires, and by using `+`, you are saying that you do not care about the version of Play Services. – CommonsWare Aug 04 '17 at 11:39
  • if im using the version like `10.2.1` the problem is the same – Mohammad Awais Aug 04 '17 at 11:42
  • you should use specific parts of the play-services library instead of pulling in the entire thing. It is huge and you definitely don't need all of it – Tim Aug 04 '17 at 11:52

1 Answers1

1

I'll refer to an answer i made to another post with a similar issue:

https://stackoverflow.com/a/42315590/2877453

Basically using the "+", you say you ALWAYS want the newest version, no matter what. You should never do this, as it'll lead to unforeseen issues, just like the one you're having now.

If you want to support lower than 14, you have to use older versions of all Google libraries.

So you'll have to replace the "+" with "10.0.1", as that's the newest version that still supports down to API 9.

When using "+", you'll get a version of "10.2" (or higher), and those only support down to API 14.

Moonbloom
  • 7,738
  • 3
  • 26
  • 38