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:
- I have downloaded Google API's for a particular API level through Android SDK manager.
- I checked off Google API as project build target.
- I have added
<uses-library android:name="com.google.android.maps" />
line into theAndroidManifest.xml
as a child of<application>
tag. - I cleaned the project by selecting
Project->Clean...
and built it from scratch. - I included
.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.