Отображение текущего местоположения на Android Google Map v2, но приложение вылетает

Вот мой код активности

package com.example1.heartconnect;

import android.location.Location;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;

import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.SupportMapFragment;
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;


public class Maps extends FragmentActivity {

GoogleMap map;

@Override
protected void onCreate(Bundle arg0) {
    // TODO Auto-generated method stub
    super.onCreate(arg0);
    setContentView(R.layout.maps);

    map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.gmap)).getMap();
    map.setMyLocationEnabled(true);
    map.setMapType(map.MAP_TYPE_NORMAL);

    Location loc = map.getMyLocation();

    double lat = loc.getLatitude();
    double lon = loc.getLongitude();
    LatLng position = new LatLng(lat, lon);

    Marker marker = map.addMarker(new MarkerOptions()
    .title("Your Location")
    .icon(BitmapDescriptorFactory
         .defaultMarker(BitmapDescriptorFactory.HUE_AZURE))
    .position(position));

    map.moveCamera(CameraUpdateFactory.newLatLngZoom(position, 10));


}
}

Это файл XML

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<fragment
      android:id="@+id/gmap"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:name="com.google.android.gms.maps.SupportMapFragment"/>
</LinearLayout>

И это файл манифеста

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example1.heartconnect"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />
<permission
    android:name="com.example1.heartconnect.permission.MAPS_RECEIVE"
    android:protectionLevel="signature" />
<uses-permission android:name="com.example1.heartconnect.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
<uses-permission android:name="android.permission.READ_SMS"/>
<uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

<uses-feature
    android:glEsVersion="0x00020000"
    android:required="true"/>

<application
    android:allowBackup="true"
    android:icon="@drawable/heart_connect"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <uses-library android:name="com.google.android.maps" />
    <activity
        android:name="com.example1.heartconnect.MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name="MyCircle"></activity>
    <activity android:name="Validate"></activity>
    <activity android:name="DisplayContacts"></activity>
    <activity android:name="Maps"></activity>
    <receiver android:name=".SMSBroadcastReceiver">
        <intent-filter>
            <action android:name="android.provider.telephony.SMS_RECEIVED"></action>
        </intent-filter>
    </receiver>
    <meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />   
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyDUFZIRGsVVpvJxHvjjoUV4G44-43JTnEw"/>  
</application>

</manifest>

Когда я удаляю эти 2 строки и указываю Latittude & Longitude вручную, приложение работает, и я вижу голую карту Google с маркером на этом LatLng.

double lat = loc.getLatitude();
double lon = loc.getLongitude();

Я также попытался найти текущее местоположение следующим образом:

LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
Criteria criteria = new Criteria();
String provider = locationManager.getBestProvider(criteria, true);
Location location = locationManager.getLastKnownLocation(provider);

Но и здесь приложение вылетает. Plz может кто-нибудь предложить мне необходимые изменения, чтобы я мог видеть мое текущее местоположение на карте ... Thnxx заранее :)

Ответы на вопрос(2)

Ваш ответ на вопрос