title: Google Maps API V2 android app on API level 8 up to 17
body: <p>I am working with the Google maps API V2 and it is going fine. i have a 2.2.2 android device wich i use to debug my app.</p>
  
  <p>now i just got a Galaxy Note 2, and when i try to debug on that device the app imidiatly crashed "project has stopped working".</p>
  
  <p>So i just made a small example to test with. and again it runs great on 2.2.2 but not on 4.1.1.</p>
  
  <p>this is the code i have for the small example exercise</p>
  
  <p>Any suggestions would be much appreciated</p>
  
  <p>My Layout</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context=".MainActivity" &gt;
  
      &lt;TextView
          android:id="@+id/tv_location"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content" /&gt;
  
      &lt;fragment xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/map"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_below="@id/tv_location"
          class="com.google.android.gms.maps.SupportMapFragment" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>My Manifest</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.ss"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="8"
          android:targetSdkVersion="17" /&gt;
  
      &lt;permission 
          android:name="com.example.ss.permission.MAPS_RECEIVE"
          android:protectionLevel="signature"/&gt;
  
  
      &lt;uses-permission android:name="com.example.ss.permission.MAPS_RECEIVE"/&gt;
      &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
      &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/&gt;
  
      &lt;uses-feature
          android:glEsVersion="0x00020000"
          android:required="true"/&gt;
  
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
  
          &lt;uses-library android:name="com.google.android.maps" /&gt;
          &lt;activity
              android:name="com.example.ss.MainActivity"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
  
          &lt;meta-data
              android:name="com.google.android.maps.v2.API_KEY"
               android:value="my key"/&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>and my testing code</p>
  
  <pre><code>public class MainActivity extends FragmentActivity implements LocationListener{
  
  private GoogleMap googleMap;
  private LatLng source;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
       int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getBaseContext());
  
          if(status!=ConnectionResult.SUCCESS){
              int requestCode = 10;
              Dialog dialog = GooglePlayServicesUtil.getErrorDialog(status, this, requestCode);
              dialog.show();
          }else{
              SupportMapFragment fm = (SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map);
  
              googleMap = fm.getMap();
  
              googleMap.setMyLocationEnabled(false);
  
              LocationManager locManager = (LocationManager) getSystemService(LOCATION_SERVICE);
  
              Criteria criteria = new Criteria();
  
              String provider = locManager.getBestProvider(criteria, true);
  
              Location loc = locManager.getLastKnownLocation(provider);
  
  
              if(loc!=null){
                  onLocationChanged(loc);
              }
              source = new LatLng(loc.getLatitude(), loc.getLongitude());
              //makeUrl = new MakeUrl(source, destination);
              //String url = makeUrl.makeLocationUrl();
              googleMap.moveCamera(CameraUpdateFactory.newLatLng(source));
              googleMap.animateCamera(CameraUpdateFactory.zoomTo(15));
          }
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.activity_main, menu);
      return true;
  }
  
  @Override
  public void onLocationChanged(Location arg0) {
      // TODO Auto-generated method stub
  
  }
  
  @Override
  public void onProviderDisabled(String arg0) {
      // TODO Auto-generated method stub
  
  }
  
  @Override
  public void onProviderEnabled(String arg0) {
      // TODO Auto-generated method stub
  
  }
  
  @Override
  public void onStatusChanged(String arg0, int arg1, Bundle arg2) {
      // TODO Auto-generated method stub
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>The stacktrace that i get on my NOTE 2</p>
  
  <pre><code>    02-17 13:03:23.135: D/dalvikvm(9527): Late-enabling CheckJNI
  02-17 13:03:23.170: E/Trace(9527): error opening trace file: No such file or directory (2)
  02-17 13:03:23.345: D/dalvikvm(9527): GC_CONCURRENT freed 179K, 6% free 12453K/13191K, paused 2ms+1ms, total 33ms
  02-17 13:03:23.345: D/dalvikvm(9527): WAIT_FOR_CONCURRENT_GC blocked 26ms
  02-17 13:03:23.575: D/dalvikvm(9527): GC_CONCURRENT freed 279K, 7% free 12634K/13511K, paused 12ms+1ms, total 24ms
  02-17 13:03:23.665: D/dalvikvm(9527): GC_CONCURRENT freed 276K, 7% free 12862K/13703K, paused 2ms+12ms, total 29ms
  02-17 13:03:23.705: D/AbsListView(9527): Get MotionRecognitionManager
  02-17 13:03:23.740: D/dalvikvm(9527): GC_CONCURRENT freed 194K, 6% free 13206K/13959K, paused 2ms+2ms, total 20ms
  02-17 13:03:23.740: D/dalvikvm(9527): WAIT_FOR_CONCURRENT_GC blocked 9ms
  02-17 13:03:23.745: D/dalvikvm(9527): WAIT_FOR_CONCURRENT_GC blocked 9ms
  02-17 13:03:23.760: D/AndroidRuntime(9527): Shutting down VM
  02-17 13:03:23.760: W/dalvikvm(9527): threadid=1: thread exiting with uncaught exception (group=0x41c802a0)
  02-17 13:03:23.760: E/AndroidRuntime(9527): FATAL EXCEPTION: main
  02-17 13:03:23.760: E/AndroidRuntime(9527): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.mm/com.example.mm.MainActivity}: java.lang.NullPointerException
  02-17 13:03:23.760: E/AndroidRuntime(9527):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2100)
  02-17 13:03:23.760: E/AndroidRuntime(9527):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
  02-17 13:03:23.760: E/AndroidRuntime(9527):     at android.app.ActivityThread.access$600(ActivityThread.java:140)
  02-17 13:03:23.760: E/AndroidRuntime(9527):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
  02-17 13:03:23.760: E/AndroidRuntime(9527):     at android.os.Handler.dispatchMessage(Handler.java:99)
  02-17 13:03:23.760: E/AndroidRuntime(9527):     at android.os.Looper.loop(Looper.java:137)
  02-17 13:03:23.760: E/AndroidRuntime(9527):     at android.app.ActivityThread.main(ActivityThread.java:4898)
  02-17 13:03:23.760: E/AndroidRuntime(9527):     at java.lang.reflect.Method.invokeNative(Native Method)
  02-17 13:03:23.760: E/AndroidRuntime(9527):     at java.lang.reflect.Method.invoke(Method.java:511)
  02-17 13:03:23.760: E/AndroidRuntime(9527):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1008)
  02-17 13:03:23.760: E/AndroidRuntime(9527):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:775)
  02-17 13:03:23.760: E/AndroidRuntime(9527):     at dalvik.system.NativeStart.main(Native Method)
  02-17 13:03:23.760: E/AndroidRuntime(9527): Caused by: java.lang.NullPointerException
  02-17 13:03:23.760: E/AndroidRuntime(9527):     at com.example.mm.MainActivity.onCreate(MainActivity.java:82)
  02-17 13:03:23.760: E/AndroidRuntime(9527):     at android.app.Activity.performCreate(Activity.java:5191)
  02-17 13:03:23.760: E/AndroidRuntime(9527):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
  02-17 13:03:23.760: E/AndroidRuntime(9527):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2064)
  02-17 13:03:23.760: E/AndroidRuntime(9527):     ... 11 more
  02-17 13:03:23.955: D/dalvikvm(9527): GC_CONCURRENT freed 233K, 6% free 13394K/14215K, paused 14ms+1ms, total 44ms
  </code></pre>