Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error package `com.google.android.gms...` doesn't exist

I am new to Android development. I am learning to use Parse.com backend service and get stuck early on.

I am following tutorial to create application that uses Google Maps Android API v2. What I've done :

  1. download sample project from parse
  2. Import AnyWall-android\Anywall folder from downloaded project to Android Studio
  3. Rebuild project

Then I get a bunch of errors here :

import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesClient;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.location.LocationClient;
import com.google.android.gms.location.LocationListener;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap.CancelableCallback;
import com.google.android.gms.maps.GoogleMap.OnCameraChangeListener;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.CameraPosition;
import com.google.android.gms.maps.model.Circle;
import com.google.android.gms.maps.model.CircleOptions;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.LatLngBounds;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;

common, location, and maps highlighted red. The question is how to resolve these errors?

I appreciate any kind of help or direction (What should I check? Is it about missing library? If it is, what library should I add and where to get it?)

like image 964
har07 Avatar asked Mar 07 '14 22:03

har07


2 Answers

Can't find the class com.google.android.gms.location.LocationClient (android)

There is some problem with the last GPS lib. You have to use an older version than the latest(6.+). Try with an older version. I didn't see anything inside the doc deprecated or missing about the LocationClient.class...

compile 'com.google.android.gms:play-services:5.+'

like image 95
user4352520 Avatar answered Oct 18 '22 07:10

user4352520


I think the best solution is, add compile API on your Gradle. services-location has this method.

 compile 'com.google.android.gms:play-services-maps:9.8.0'
 compile 'com.google.android.gms:play-services-location:9.8.0'

if you wish to include other services, please refer here: https://developers.google.com/android/guides/setup (scroll down)

like image 22
Md Imran Choudhury Avatar answered Oct 18 '22 07:10

Md Imran Choudhury