Reputation: 1
I continually have this problem that I'm hoping someone can help me to better understand what's going on.
I'm working on an Android app in Android Studio (currently v0.4.0). The app files are shared in Google Docs (I will be moving them to git asap) so the project files are they same. However opening the project on my laptop works perfectly, whereas opening the project on my desktop results in the following gradle build error "Could not find com.google.android.gms:play-services:4.0.30"
In both my laptop and desktop I am up to date in the SDK manager installs, in both systems I am using the Android Studio Android SDK, and I have added the google-play-services.jar file to a "libs" folder within my project. Also, the libraries/dependencies as listed under "Project Settings" are the same in both systems..
I have read that this can be caused by the systems version of the file not matching what is in the build.gradle file, in my case "compile 'com.google.android.gms:play-services:4.0.30'" however I don't understand where to find that version number "4.0.30". And why would it be different between my laptop and desktop when both are using the most current updates?
In the past I've corrected this problem through a sporadic combination of "tips" found online, usually resulting in reinstalling everything, however I'd prefer to understand what's actually going on here.
My assumption is that there are local variables on each system, possibly in hidden profile preferences or caches that are in conflict, but if that's the case can I manage them?
Please help! :(
Upvotes: 0
Views: 114
Reputation: 4717
Basically ensure that you have identical configurations on both your desktop and laptop (ie android sdk path etc) It looks like you may have them on different directory paths.
Also the Google Play Service versions installed on your machine can be found in ..\android-studio\sdk\extras\google\m2repository\com\google\android\gms\play-services
Upvotes: 0
Reputation: 1669
Gradle dependencies don't look in the libs
directory unless you tell it to.
You should also ditch the GMS lib from your libs
directory and simply use the artifact that Gradle will download for you.
The particular issue you are having is likely that you don't have the Google Repository
on one of the machines. Open your SDK Manager and install that repo (Scroll all the way down to the "Extras" Category), then Gradle should be able to pick that up and include it in your project.
Upvotes: 2