I am new to Android development. By following this tutorial I got errors The import com.google.android.gms cannot be resolved
when I wrote the code into the MainActivity.java
:
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
By searching for various fixes I made sure to try these out:
<uses-library android:name="com.google.android.maps" />
line into the AndroidManifest.xml
as a child of <application>
tag.Project->Clean...
and built it
from scratch..jar
file for maps by right-clicking on my project, went
to build path and added external archive locating it in my SDK: android-sdk-windows\add-ons\addon_google_apis_google_inc_8\libs\maps
Unfortunately, none of the above have helped.
Another way is to let Eclipse do the import work for you. Hover your mouse over the com.google.android.gms
import that can not be resolved and towards the bottom of the popup menu, select the Fix project setup... option as below. Then it'll prompt to import the google play services library. Select that and you should be good to go.