1
votes

Just moved to AS from Eclipse. Trying to build an existing (working) project. It keeps giving me this error

Error:Could not find com.google.android.gms:play-services:9.2.0.
Searched in the following locations: file:/C:/utils/AndroidStudio/gradle/m2repository/com/google/android/gms/play-services/9.2.0/play-services-9.2.0.pom
file:/C:/utils/AndroidStudio/gradle/m2repository/com/google/android/gms/play-services/9.2.0/play-services-9.2.0.jar
https://jcenter.bintray.com/com/google/android/gms/play-services/9.2.0/play-services-9.2.0.pom
https://jcenter.bintray.com/com/google/android/gms/play-services/9.2.0/play-services-9.2.0.jar
Required by: :Personal_weather:unspecified

The library is not in the studio directory (AndroidStudio), it is in the SDK directory (AndroidSDK), which the installation procedure insisted upon. I have installed the google repository using SDK Manager. In project setup I have the correct location of the SDK. How do I force AS to look in the correct directory?

1

1 Answers

0
votes

The help files I had read so far said that I had to add classpath and compile members to the dependencies of the gradle files. In the build.gradle for the project in dependencies I had

classpath 'com.google.android.gms:play-services:9.2.0'

But I had also added the library to the project structure via the

File->Project Structure->Modules->app->Dependencies 

menu. So, on a whim, I commented out the classpath statement.

In the build.gradle for the module in dependencies I had

compile 'com.google.android.gms:play-services:9.2.0'

which I left in. This is now compiling. There is a lot of conflicting information around regarding AndroidStudio so trial and error seems the way to go.