Christian Eriksson
Christian Eriksson

Reputation: 2208

What determines the highest version of play-service an app can use?

I have an app which uses play-services for Places API calls. I've added the dependencies to my app build.gradle script as so:

'com.google.android.gms:play-services-places:11.0.4'

My question is about the version number specified in this line. Reading the introduction on the devloper-site there is no mention about how to choose this number. Reading it one is led to use 11.4.2 (the newest as of writing). However using this value I receive a "Failed to resolve: com.google.android.gms:play-services-places:11.4.2" error. And a message to "Install Repository" and try again, though the SDK Manager couldn't find the dependency.

Trail and error led me to a version number that works for me. Though I would like to know what settings decide which is the highest version number for play services one can use?

Is it, for example, the minSDKVersion (19 in my case)? And is there a resource where I can match my configuration to a "max available" play-service version?

Upvotes: 1

Views: 194

Answers (1)

GAGAN BHATIA
GAGAN BHATIA

Reputation: 601

First of all, when we compile a project with a certain version number of play services, it checks the same in the android sdk locally. If the version we specified exists in local sdk, it uses the same.

Else it tries to download it from remote and places it to local sdk. Hence u faced

"Failed to resolve: com.google.android.gms:play-services-places:11.4.2" error. And a message to "Install Repository" and try again, though the SDK Manager couldn't find the dependency.

How to decide lastes version :-

Try to add dependencies from studio itself.It searches the lastes available and uses them.

Go to the Project Structure --> select Dependencies tab --> click on + --> select Library dependency --> Search playservices and add from there.

Upvotes: 1

Related Questions