I have downloaded MapBox jar file from here and added to my eclipse project. I am getting following exception when running the app.
02-01 13:11:42.867: E/AndroidRuntime(2674): java.lang.NoClassDefFoundError: com.mapbox.mapboxsdk.MapboxAccountManager 02-01 13:11:42.867: E/AndroidRuntime(2674): at com.example.mapbox.MainActivity.onCreate(MainActivity.java:18)
here is my code:
public class MainActivity extends Activity {
private MapView mapView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
MapboxAccountManager.start(this, getString(R.string.access_token));
setContentView(R.layout.activity_main);
mapView = (MapView) findViewById(R.id.mapView);
mapView.onCreate(savedInstanceState);
mapView.getMapAsync(new OnMapReadyCallback() {
@Override
public void onMapReady(MapboxMap arg0) {
// TODO Auto-generated method stub
}
});
}
activity_main
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:mapbox="http://schemas.android.com/apk/lib/mapbox"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".examples.basics.SimpleMapViewActivity">
<!-- Set the starting camera position and map style using xml-->
<com.mapbox.mapboxsdk.maps.MapView
android:id="@+id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent"
mapbox:center_latitude="40.73581"
mapbox:center_longitude="-73.99155"
mapbox:style_url="@string/url"
mapbox:zoom="11" />
</RelativeLayout>
Please help me. I have searched a lot but nothing found useful. Thanks in advance.