title: Error with Google Play Service Client
body: <p>I've been working on trying to get this android project to work in android studio with gradle. I'm fairly new to it all so it may be a simple issue but I have spent quite a few days and cannot get past this error I receive when trying to run my project:</p>
  
  <pre><code>Error:(25, 62) error: package com.google.android.gms.common.GooglePlayServicesClient does not exist
  Error:(26, 62) error: package com.google.android.gms.common.GooglePlayServicesClient does not exist
  Error:(27, 39) error: cannot find symbol class LocationClient
  Error:(42, 60) error: cannot find symbol class ConnectionCallbacks
  Error:(43, 3) error: cannot find symbol class OnConnectionFailedListener
  Error:(82, 10) error: cannot find symbol class LocationClient
  Error:(586, 26) error: cannot find symbol class LocationClient
  Error:(618, 2) error: method does not override or implement a method from a supertype
  Error:(627, 2) error: method does not override or implement a method from a supertype
  Error:(635, 2) error: method does not override or implement a method from a supertype
  
  Error:Execution failed for task ':compileDebugJava'.
  &gt; Compilation failed; see the compiler error output for details.
  </code></pre>
  
  <p>Here is the top portion of the file the errors are coming from (i've marked troubled lines):</p>
  
  <pre><code>package edu.gatech.ppl.cycleatlanta;
  
  import android.app.AlertDialog;
  import android.content.ComponentName;
  import android.content.Context;
  import android.content.DialogInterface;
  import android.content.Intent;
  import android.content.ServiceConnection;
  import android.location.Location;
  import android.location.LocationManager;
  import android.os.Bundle;
  import android.os.Handler;
  import android.os.IBinder;
  import android.provider.Settings;
  import android.support.v4.app.Fragment;
  import android.util.Log;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.Button;
  import android.widget.TextView;
  import android.widget.Toast;
  
  import com.google.android.gms.common.ConnectionResult;
  import com.google.android.gms.common.***GooglePlayServicesClient***.ConnectionCallbacks;
  import com.google.android.gms.common.***GooglePlayServicesClient***.OnConnectionFailedListener;
  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;
  import com.google.android.gms.maps.GoogleMap.OnMyLocationButtonClickListener;
  import com.google.android.gms.maps.SupportMapFragment;
  import com.google.android.gms.maps.UiSettings;
  import com.google.android.gms.maps.model.LatLng;
  
  import java.text.SimpleDateFormat;
  import java.util.TimeZone;
  import java.util.Timer;
  import java.util.TimerTask;
  
  public class FragmentMainInput extends Fragment implements **ConnectionCallbacks**,
          **OnConnectionFailedListener**, LocationListener,
          OnMyLocationButtonClickListener {
  
      public static final String ARG_SECTION_NUMBER = "section_number";
  
      Intent fi;
      TripData trip;
      NoteData note;
      boolean isRecording = false;
      Timer timer;
      float curDistance;
  
      TextView txtDuration;
      TextView txtDistance;
      TextView txtCurSpeed;
  
      int zoomFlag = 1;
  
      Location currentLocation = new Location("");
  
      final SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
  
      // Need handler for callbacks to the UI thread
      final Handler mHandler = new Handler();
      final Runnable mUpdateTimer = new Runnable() {
          public void run() {
              updateTimer();
          }
      };
  
      private final static int MENU_USER_INFO = 0;
      private final static int MENU_HELP = 1;
  
      private final static int CONTEXT_RETRY = 0;
      private final static int CONTEXT_DELETE = 1;
  
      DbAdapter mDb;
      GoogleMap map;
      UiSettings mUiSettings;
      private LocationClient mLocationClient;
  
      private static final LocationRequest REQUEST = LocationRequest.create()
              .setInterval(5000) // 5 seconds
              .setFastestInterval(16) // 16ms = 60fps
              .setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
  
      public FragmentMainInput() {
      }
  </code></pre>
  
  <p>When I hover the lines flagged in the code:</p>
  
  <pre><code>import com.google.android.gms.common.GooglePlayServicesClient.ConnectionCallbacks;
  import com.google.android.gms.common.GooglePlayServicesClient.OnConnectionFailedListener;
  import com.google.android.gms.location.LocationClient;
  </code></pre>
  
  <p>It says:"cannot resolve symbol"</p>
  
  <p>Here is my build.gradle file:</p>
  
  <pre><code> buildscript {
              repositories {
                  jcenter()
              }
  
              dependencies {
                  classpath 'com.android.tools.build:gradle:1.1.0'
  
  // NOTE: Do not place your application dependencies here; they
  // belong in the individual module build.gradle files
              }
          }
  
  allprojects {
      repositories {
          jcenter()
      }
  }
  
  
  apply plugin: 'com.android.application'
  
  dependencies {
  
      compile 'com.android.support:appcompat-v7:22.0.0'
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile 'com.google.android.gms:play-services:7.0.0'
      compile files('libs/android-support-v4.jar')
  
  }
  
  android {
      compileSdkVersion 22
      buildToolsVersion "22"
      compileOptions.encoding = 'windows-1251'
  
      defaultConfig {
  
          minSdkVersion 19
          targetSdkVersion 22
          versionCode 2
          versionName "2.0"
      }
  
  
      sourceSets {
          main {
              manifest.srcFile 'AndroidManifest.xml'
              java.srcDirs = ['src']
              resources.srcDirs = ['src']
              aidl.srcDirs = ['src']
              renderscript.srcDirs = ['src']
              res.srcDirs = ['res']
              assets.srcDirs = ['assets']
          }
  
          // Move the tests to tests/java, tests/res, etc...
          instrumentTest.setRoot('tests')
  
          // Move the build types to build-types/&lt;type&gt;
          // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
          // This moves them out of them default location under src/&lt;type&gt;/... which would
          // conflict with src/ being used by the main source set.
          // Adding new build types or product flavors should be accompanied
          // by a similar customization.
          debug.setRoot('build-types/debug')
          release.setRoot('build-types/release')
      }
  }
  </code></pre>
  
  <p>And also here is my manifest:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="edu.gatech.ppl.cycleatlanta"
      android:versionCode="2"
      android:versionName="2.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="19"
          android:targetSdkVersion="22" /&gt;
  
      &lt;uses-feature
          android:glEsVersion="0x00020000"
          android:required="true" /&gt;
      &lt;uses-feature
          android:name="android.hardware.camera"
          android:required="false" &gt;
      &lt;/uses-feature&gt;
  
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
      &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" &gt;
      &lt;/uses-permission&gt;
      &lt;uses-permission android:name="android.permission.INTERNET" &gt;
      &lt;/uses-permission&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;activity
              android:name="edu.gatech.ppl.cycleatlanta.TabsConfig"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="edu.gatech.ppl.cycleatlanta.MainInputActivity"
              android:label="@string/title_activity_main_input" &gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="edu.gatech.ppl.cycleatlanta.TripPurposeActivity"
              android:label="@string/title_activity_trip_purpose" &gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="edu.gatech.ppl.cycleatlanta.UserInfoActivity"
              android:label="@string/title_activity_user_info" &gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="edu.gatech.ppl.cycleatlanta.TripMapActivity"
              android:label="@string/title_activity_trip_map" &gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="edu.gatech.ppl.cycleatlanta.SavedTripsActivity"
              android:label="@string/title_activity_saved_trips" &gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="edu.gatech.ppl.cycleatlanta.TripDetailActivity"
              android:label="@string/title_activity_trip_detail" &gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="edu.gatech.ppl.cycleatlanta.NoteTypeActivity"
              android:label="@string/title_activity_note_type" &gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="edu.gatech.ppl.cycleatlanta.NoteDetailActivity"
              android:label="@string/title_activity_note_detail" &gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="edu.gatech.ppl.cycleatlanta.NoteMapActivity"
              android:label="@string/title_activity_note_map" &gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="edu.gatech.ppl.cycleatlanta.SavedNotesActivity"
              android:label="@string/title_activity_saved_notes" &gt;
          &lt;/activity&gt;
  
          &lt;service
              android:name="edu.gatech.ppl.cycleatlanta.RecordingService"
              android:enabled="true"
              android:exported="true" &gt;
          &lt;/service&gt;
  
          &lt;activity
              android:name="edu.gatech.ppl.cycleatlanta.MainActivity"
              android:label="@string/title_activity_main" &gt;
          &lt;/activity&gt;
  
          &lt;meta-data
              android:name="com.google.android.maps.v2.API_KEY"
              android:value="AIzaSyB9orX8RcKrVvF8Vg1_yMhIvu59XUW_inw" /&gt;
  
          &lt;meta-data android:name="com.google.android.gms.version"
              android:value="@integer/google_play_services_version" /&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>It seems to me there is a problem with the google play service linking. I've followed several different examples and definitely have it downloaded but I cant get it to work. Also I have a feeling my manifest (nout sure about the correct targets for sdk version) and gradle file (jcenter or maven?and setting proper dependencies)  may be configured improperly.</p>
  
  <p>Any help with this would be great I've spent the last few days scouring the interwebs but I have not been able to solve what Im sure is a simple issue...</p>