Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error importing com.google.android.gms.*;

I am trying to implement the solution in link

Require to import these:

import com.google.android.gms.common.ConnectionResult;  
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.common.GooglePlayServicesClient.ConnectionCallbacks; 
import com.google.android.gms.common.GooglePlayServicesClient.OnConnectionFailedListener; import com.google.android.gms.location.ActivityRecognitionClient;

i cannot compile because eclipse does not recognize

 "com.google.android.gms."......

Have also updated the SDK and the google API to the latest (4.3)

Still not able to import the package.

like image 670
ofir_aghai Avatar asked Jul 25 '13 08:07

ofir_aghai


3 Answers

Follow this guide to setup the Google Play Services SDK. It's a client library which you have to get from the SDK Manager. After you downloaded it, add the library as a project.

like image 75
Steve Benett Avatar answered Nov 04 '22 16:11

Steve Benett


  1. Import Google Play service as C:\adt-bundle-windows-x86_64-20130729\adt-bundle-windows-x86_64-20130729\sdk\extras\google\google_play_services

  2. Select libproject

  3. Select your project, go to properties, and under Android add Google Play service library.

NOTE: you have to install Google Play service from SDK Manager.

like image 3
user2465381 Avatar answered Nov 04 '22 18:11

user2465381


To add to all the answers, make sure the android-support-v4.jar is same in both the MainProject and library project. If they are found to be different, the library project jars to not get added to your apk and you can get class not found error.

like image 1
Ranjeet Avatar answered Nov 04 '22 17:11

Ranjeet