20

Today I updated Android SDK components to the newest version and somehow the whole com.google.android.gms package is gone. Instead, there is only com.google.android.maps with different classes than those in gms package. Is it a big change form Google or have I done something wrong? I have been using GoogleMap and LatLng classes to work with google maps and now I have just errors in my project.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
vandus
  • 3,248
  • 3
  • 30
  • 44
  • Which version of the sdk were you using before? (If you remember) – crazylpfan Mar 09 '13 at 10:38
  • android:minSdkVersion="8" android:targetSdkVersion="17" And now I have just updated the newest revisions:Android SDK tools rev.21, Android platform-tools rev.16.0.2, Android Support Library rev.12, GooglePlayServices rev.5 and some other revisions for API 17,16 etc. I ust updated everything. Also ADT tools had to be updated to work with the SDK updates – vandus Mar 09 '13 at 10:43
  • Are you using the GoogleMap v1 in your application ? – GrIsHu Mar 09 '13 at 10:50
  • No, I am using GoogleMap v2. I have the API key in AndroidManifest..Everything worked well until this stupid update – vandus Mar 09 '13 at 10:52
  • Did this ever get resolved? I just updated and I'm stuck. – Sudhanshu May 20 '13 at 20:25

6 Answers6

18

Is it a big change form Google or have I done something wrong?

com.google.android.gms comes from the Play Services SDK, which you attach to your application project as an Android library project. Please check your environment to ensure that you have a valid copy of the Play Services library project and that your application project still points to it.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • 1
    any idea wjy this the package name contains gms instead of gps ? Does it come from a pre-google-play era ? – ddewaele May 20 '13 at 17:39
  • 1
    @ddewaele The Play Store was known as Android Market before so, I guess, that's where the 'm' comes from. Changing it would have broken imports and probably caused unnecessary confusion with GPS as well. – Ravi K Thapliyal Oct 18 '15 at 23:13
  • 6
    @ddewaele, actually gms comes from "Google Mobile Services" (see https://www.android.com/gms/) for more info – Tash Pemhiwa Oct 31 '16 at 14:49
4

First off, if you did not run any updates with Android SDK Manager make sure the google-play-services-lib' project is open in eclipse. If this doesn't fix your problem then proceed. Note: eclipse(v22.0.1-685705) will close google-play-services-lib project with a 'close unrelated projects' command. The google-play-services-lib project must be open.

I figured this problem out. Initially, you/I installed Google Play services in eclipse directly from the SDK Path, (SDK Path is displayed on the top left of Android SDK Manager). When you updated Google Play services with the Android SDK Manager it deleted the .project file and now eclipse can't find the 'google-play-services-lib' project and your development project fails to compile. :-(

Solution:

The basic ideal of this solution is to clean out the old 'google-play-services-lib' project in eclipse, which is now defunct and install a new one with the project copied from the SDK path.

Delete the old project:

In eclipse delete any 'google-play-services-lib' project. (In Eclipse see: Project properties-> Android -> Library.)

In In Eclipse see: Project properties-> Android -> Library delete the old entry for 'google-play-services-lib' project. This will most likely have an red 'X' on it.

Install a new one:

Follow the instruction from Google to install 'google-play-services-lib' project. These instruction specify to copy the project out of the SDK install folder; and then how to set up the projects.

http://developer.android.com/google/play-services/setup.html

Notes:

Your name for 'google-play-services-lib' may be different.

The key to remember is that Google play services is not a jar file. It is a project in eclipse. Your, development project references the google-play-services-lib project.

By copying the project folder from the SDK path to another location, this will keep the Android SDK Manager from deleting your eclipse .project file, and causing this problem. The draw back is if you would like to update google play services, you have to remember to do all the steps again.

fishjd
  • 1,617
  • 1
  • 18
  • 31
1

You will need Google Play Services sdk. You can install it from Android SDK Manager, if you are using sdk for eclipse.
After installing Google Play services, you can import the library project in your Workspace from ..\sdk\extras\google\google_play_services folder. Clean and build it.
Now you can go to the properties of project having problem and select the library project in Android section.
This should work!

Mitech
  • 400
  • 4
  • 6
0

If using Android Studio you can add the Google Play Services to use the Google Android Maps v2 by adding a dependency to the build.gradle file.

dependencies {
    compile 'com.google.android.gms:play-services:3.1.36'
}
frogatto
  • 28,539
  • 11
  • 83
  • 129
0

Currently library is in Google Repository. To enable it make sure you have downloaded it using Android SDK Manager (down to the very bottom of the list).

robotoaster
  • 3,082
  • 1
  • 24
  • 23
0

For android create project [...] ant CLI-based project

Similar to: How to correctly include the support library in non-Eclipse Android application

The best I could find was https://stackoverflow.com/a/30689979/895245:

  1. copy paste android-sdk/extras/google/google_play_services/libproject/google-play-services_lib directory in the project directory
  2. cd into it and run android update project -p . -t android-22
  3. add <property name="android.library.reference.1" value="./google-play-services_lib"/> to your build.xml.

You can install extras with the android GUI tool, or with this CLI method: Downloading the Android support library from command line

If you just copy paste the .jar in <sdk>/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar under the libs/ directory of the project, it compiles but breaks at runtime because of the required res/values/version.xml which is not included in the .jar.

Community
  • 1
  • 1
Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985