title: Error on loading maps after splash screen
body: <p>I've got a typical problem here. I've tried loading Android maps successfully and also tried loading splash screens successfully.</p>
  
  <p>Now when i try to load maps after a splash screen i get the following exception</p>
  
  <pre><code>04-08 00:35:46.890: E/AndroidRuntime(19891): FATAL EXCEPTION: main
  04-08 00:35:46.890: E/AndroidRuntime(19891): java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable
  04-08 00:35:46.890: E/AndroidRuntime(19891):    at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source)
  04-08 00:35:46.890: E/AndroidRuntime(19891):    at com.google.android.gms.maps.MapFragment.onInflate(Unknown Source)
  04-08 00:35:46.890: E/AndroidRuntime(19891):    at android.app.Activity.onCreateView(Activity.java:4242)
  04-08 00:35:46.890: E/AndroidRuntime(19891):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:673)
  04-08 00:35:46.890: E/AndroidRuntime(19891):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
  04-08 00:35:46.890: E/AndroidRuntime(19891):    at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
  04-08 00:35:46.890: E/AndroidRuntime(19891):    at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
  04-08 00:35:46.890: E/AndroidRuntime(19891):    at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
  04-08 00:35:46.890: E/AndroidRuntime(19891):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
  04-08 00:35:46.890: E/AndroidRuntime(19891):    at android.app.Activity.setContentView(Activity.java:1835)
  04-08 00:35:46.890: E/AndroidRuntime(19891):    at com.example.androidmapsv2.MainActivity.onCreate(MainActivity.java:53)
  04-08 00:35:46.890: E/AndroidRuntime(19891):    at android.app.Activity.performCreate(Activity.java:4465)
  04-08 00:35:46.890: E/AndroidRuntime(19891):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
  04-08 00:35:46.890: E/AndroidRuntime(19891):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
  04-08 00:35:46.890: E/AndroidRuntime(19891):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
  04-08 00:35:46.890: E/AndroidRuntime(19891):    at android.app.ActivityThread.access$600(ActivityThread.java:123)
  04-08 00:35:46.890: E/AndroidRuntime(19891):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
  04-08 00:35:46.890: E/AndroidRuntime(19891):    at android.os.Handler.dispatchMessage(Handler.java:99)
  04-08 00:35:46.890: E/AndroidRuntime(19891):    at android.os.Looper.loop(Looper.java:137)
  04-08 00:35:46.890: E/AndroidRuntime(19891):    at android.app.ActivityThread.main(ActivityThread.java:4424)
  04-08 00:35:46.890: E/AndroidRuntime(19891):    at java.lang.reflect.Method.invokeNative(Native Method)
  04-08 00:35:46.890: E/AndroidRuntime(19891):    at java.lang.reflect.Method.invoke(Method.java:511)
  04-08 00:35:46.890: E/AndroidRuntime(19891):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
  04-08 00:35:46.890: E/AndroidRuntime(19891):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
  04-08 00:35:46.890: E/AndroidRuntime(19891):    at dalvik.system.NativeStart.main(Native Method)
  04-08 00:35:49.703: I/Process(19891): Sending signal. PID: 19891 SIG: 9
  </code></pre>
  
  <p>I've followed all the basic procedures to embed maps and to display splash screens since I've succeeded when i tried implementing them separately. </p>
  
  <p>I've made sure the google-play-services jar and the android-supportv4 jar are in libs folder and are referenced properly.</p>
  
  <hr>
  
  <p>MainActivity.java</p>
  
  <hr>
  
  <pre><code>package com.example.androidmapsv2;
  
  import com.google.android.gms.common.ConnectionResult;
  import com.google.android.gms.common.GooglePlayServicesUtil;
  import com.google.android.gms.maps.CameraUpdateFactory;
  import com.google.android.gms.maps.GoogleMap;
  import com.google.android.gms.maps.GoogleMap.OnMapLongClickListener;
  import com.google.android.gms.maps.MapFragment;
  //import com.google.android.gms.maps.SupportMapFragment;
  import com.google.android.gms.maps.GoogleMap.OnMapClickListener;
  import com.google.android.gms.maps.model.LatLng;
  import com.google.android.gms.maps.model.MarkerOptions;
  import com.google.android.gms.maps.model.PolylineOptions;
  
  import android.app.Activity;
  import android.app.AlertDialog;
  import android.app.FragmentManager;
  import android.content.Context;
  import android.location.Criteria;
  import android.location.Location;
  import android.location.LocationListener;
  import android.location.LocationManager;
  import android.os.Bundle;
  //import android.support.v4.app.FragmentActivity;
  //import android.support.v4.app.FragmentManager;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.widget.TextView;
  import android.widget.Toast;
  
  public class MainActivity extends Activity implements OnMapClickListener,
          OnMapLongClickListener, LocationListener {
  
      final int RQS_GooglePlayServices = 1;
      private GoogleMap myMap;
  
      Location myLocation;
      TextView tvLocInfo;
      LocationListener myLocationListener;
  
      double CURRENT_LAT = 0.0;
      double CURRENT_LON = 0.0;
  
      double PREVIOUS_LAT = 0.0;
      double PREVIOUS_LON = 0.0;
  
      LocationManager locationManager;
      String provider;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          tvLocInfo = (TextView) findViewById(R.id.locinfo);
  
          FragmentManager myFragmentManager = getFragmentManager();
          MapFragment myMapFragment = (MapFragment) myFragmentManager
                  .findFragmentById(R.id.map);
          myMap = myMapFragment.getMap();
  
          myMap.setMyLocationEnabled(true);
  
          // myMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);
          myMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
          // myMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
          // myMap.setMapType(GoogleMap.MAP_TYPE_TERRAIN);
  
          // Getting LocationManager object
          locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
  
          // Creating an empty criteria object
          Criteria criteria = new Criteria();
  
          // Getting the name of the provider that meets the criteria
          provider = locationManager.getBestProvider(criteria, false);
  
          if (provider != null &amp;&amp; !provider.equals("")) {
  
              // Get the location from the given provider
              Location location = locationManager.getLastKnownLocation(provider);
  
              locationManager.requestLocationUpdates(provider, 20000, 1, this);
  
              if (location != null) {
                  onLocationChanged(location);
              } else {
                  Toast.makeText(getBaseContext(), "Location can't be retrieved",
                          Toast.LENGTH_SHORT).show();
              }
          } else {
              Toast.makeText(getBaseContext(), "No Provider Found",
                      Toast.LENGTH_SHORT).show();
          }
  
          myMap.setOnMapClickListener(this);
          myMap.setOnMapLongClickListener(this);
  
      }
  
      @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 boolean onOptionsItemSelected(MenuItem item) {
          switch (item.getItemId()) {
          case R.id.menu_legalnotices:
              String LicenseInfo = GooglePlayServicesUtil
                      .getOpenSourceSoftwareLicenseInfo(getApplicationContext());
              AlertDialog.Builder LicenseDialog = new AlertDialog.Builder(
                      MainActivity.this);
              LicenseDialog.setTitle("Legal Notices");
              LicenseDialog.setMessage(LicenseInfo);
              LicenseDialog.show();
              return true;
          }
          return super.onOptionsItemSelected(item);
      }
  
      @Override
      protected void onResume() {
          // TODO Auto-generated method stub
          super.onResume();
  
          int resultCode = GooglePlayServicesUtil
                  .isGooglePlayServicesAvailable(getApplicationContext());
  
          if (resultCode == ConnectionResult.SUCCESS) {
              Toast.makeText(getApplicationContext(),
                      "isGooglePlayServicesAvailable SUCCESS", Toast.LENGTH_LONG)
                      .show();
          } else {
              GooglePlayServicesUtil.getErrorDialog(resultCode, this,
                      RQS_GooglePlayServices);
          }
  
      }
  
      @Override
      public void onMapClick(LatLng point) {
          tvLocInfo.setText(point.toString());
          myMap.animateCamera(CameraUpdateFactory.newLatLng(point));
      }
  
      @Override
      public void onMapLongClick(LatLng point) {
          tvLocInfo.setText("New marker added@" + point.toString());
          myMap.addMarker(new MarkerOptions().position(point).title(
                  point.toString()));
          // Polyline line =
  //      myMap.addPolyline(new PolylineOptions().add(
  //              new LatLng(12.97202903709172, 80.21577659994364),
  //              new LatLng(12.978670181826473, 80.2174412459135))
  //              .geodesic(true));
  
          double lat = point.latitude;
          double lon = point.longitude;
  
          System.out.println("lat = "+lat);
  
          CURRENT_LAT = lat;
          CURRENT_LON = lon;
  
          tvLocInfo.setText("lat: " + lat + "\n" + "lon: " + lon);
  
          LatLng latlng = new LatLng(lat,
                  lon);
  
          myMap.animateCamera(CameraUpdateFactory.newLatLng(latlng));
  
          if (CURRENT_LAT != 0.0 &amp;&amp; CURRENT_LON != 0.0 &amp;&amp; PREVIOUS_LAT != 0.0
                  &amp;&amp; PREVIOUS_LON != 0.0) {
              myMap.addPolyline(new PolylineOptions().add(
                      new LatLng(PREVIOUS_LAT, PREVIOUS_LON),
                      new LatLng(CURRENT_LAT, CURRENT_LON)).geodesic(true));
          }
          PREVIOUS_LAT = CURRENT_LAT;
          PREVIOUS_LON = CURRENT_LON;
  
      }
  
      @Override
      public void onLocationChanged(Location myLocation) {
          // TODO Auto-generated method stub
          // if (myLocationListener != null) {
          // myLocationListener.onLocationChanged(myLocation);
  
          double lat = myLocation.getLatitude();
          double lon = myLocation.getLongitude();
  
          CURRENT_LAT = lat;
          CURRENT_LON = lon;
  
          tvLocInfo.setText("lat: " + lat + "\n" + "lon: " + lon);
  
          LatLng latlng = new LatLng(myLocation.getLatitude(),
                  myLocation.getLongitude());
  
          myMap.animateCamera(CameraUpdateFactory.newLatLng(latlng));
  
          if (CURRENT_LAT != 0.0 &amp;&amp; CURRENT_LON != 0.0 &amp;&amp; PREVIOUS_LAT != 0.0
                  &amp;&amp; PREVIOUS_LON != 0.0) {
              myMap.addPolyline(new PolylineOptions().add(
                      new LatLng(PREVIOUS_LAT, PREVIOUS_LON),
                      new LatLng(CURRENT_LAT, CURRENT_LON)).geodesic(true));
          }
          PREVIOUS_LAT = CURRENT_LAT;
          PREVIOUS_LON = CURRENT_LON;
  
          // }
      }
  
      @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>
  
  <hr>
  
  <h2>SplashScreen.java</h2>
  
  <pre><code>package com.example.androidmapsv2;
  
  
  import android.app.Activity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.os.Handler;
  
  public class SplashScreen extends Activity {
  
      private static final int SPLASH_TIME = 3 * 1000;// 3 seconds
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.splashscreen);
  
          new Handler().postDelayed(new Runnable() {
  
              @Override
              public void run() {
  
                  Intent intent = new Intent(SplashScreen.this,
                          MainActivity.class);
                  startActivity(intent);
  
                  SplashScreen.this.finish();
  
                  overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
  
              }
          }, SPLASH_TIME);
  
          new Handler().postDelayed(new Runnable() {
                @Override
                public void run() {
                       } 
                  }, SPLASH_TIME);
  
      }
  
  
      @Override
      public void onBackPressed() {
          this.finish();
          super.onBackPressed();
      }
  }
  </code></pre>
  
  <hr>
  
  <h2>activity_main.xml</h2>
  
  <pre><code>&lt;LinearLayout 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"
      android:orientation="vertical"
      tools:context=".MainActivity" &gt;
  
      &lt;TextView
          android:id="@+id/locinfo"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"/&gt;
      &lt;fragment
          android:id="@+id/map"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          class="com.google.android.gms.maps.MapFragment"/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <hr>
  
  <h2>splashscreen.xml</h2>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent" android:background="@drawable/splash"
      android:layout_height="fill_parent"
      android:orientation="vertical" &gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <hr>
  
  <h2>AndroidManifest.xml</h2>
  
  <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.androidmapsv2"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="11"
          android:targetSdkVersion="16" /&gt;
  
      &lt;permission
          android:name="com.example.androidmapsv2.permission.MAPS_RECEIVE"
          android:protectionLevel="signature" &gt;
      &lt;/permission&gt;
  
      &lt;uses-permission android:name="com.example.androidmapsv2.permission.MAPS_RECEIVE" /&gt;
      &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /&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="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;meta-data
              android:name="com.google.android.maps.v2.API_KEY"
              android:value="AIzaSyAkfu2ZAgQfO6iQ_ldkOAaVyMOPDmq_Lg0" /&gt;
  
          &lt;activity
              android:name="com.example.androidmapsv2.SplashScreen"
              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;activity android:name="com.example.androidmapsv2.MainActivity" &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>pls see the below structure</p>
  
  <p><img src="https://i.stack.imgur.com/igP6b.png" alt="enter image description here"></p>
  
  <p>I've also used the latest API key and other basic things.</p>