title: java.lang.noclassdeffounderror: com.google.android.gms.R$styleable
body: <p>I am creating an android application using google maps. here is the code:</p>
  
  <p>MapFragActivity.java</p>
  
  <pre><code> import android.os.Bundle;
      import android.support.v4.app.FragmentActivity;
      import com.google.android.gms.maps.GoogleMap;
      import com.google.android.gms.maps.SupportMapFragment;
  
      public class MapFragActivity extends FragmentActivity {
  
      private GoogleMap map;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_map_frag);
  
          map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))
                  .getMap();
       }
      }
  </code></pre>
  
  <p>AndroidManifest.xml:</p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.him.mapfrag_rnd"
          android:versionCode="1"
          android:versionName="1.0" &gt;
  
          &lt;uses-sdk
              android:minSdkVersion="11"
              android:targetSdkVersion="15" /&gt;
  
  
          &lt;permission
              android:name="com.him.mapfrag_rnd.permission.MAPS_RECEIVE"
              android:protectionLevel="signature" /&gt;
  
          &lt;uses-permission android:name="com.him.mapfrag_rnd.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="android.permission.ACCESS_COARSE_LOCATION" /&gt;
          &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
          &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /&gt;
  
            &lt;uses-feature
              android:glEsVersion="0x00020000"
              android:required="true" /&gt;
  
  
          &lt;application
              android:icon="@drawable/ic_launcher"
              android:label="@string/app_name"
              android:theme="@style/AppTheme" &gt;
              &lt;activity
                  android:name=".MapFragActivity"
                  android:label="@string/title_activity_map_frag" &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_api_key" /&gt;
  
          &lt;/application&gt;
  
      &lt;/manifest&gt;
  </code></pre>
  
  <p>activity_map_frag.xml:</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent" &gt;
  
      &lt;fragment
        android:id="@+id/map"
        android:name="com.google.android.gms.maps.SupportMapFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent" /&gt;
  
      &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>when I try this code I get an error, here is the log:</p>
  
  <pre><code>01-17 10:01:17.685: E/AndroidRuntime(8923): FATAL EXCEPTION: main
      01-17 10:01:17.685: E/AndroidRuntime(8923): java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable
      01-17 10:01:17.685: E/AndroidRuntime(8923):     at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source)
      01-17 10:01:17.685: E/AndroidRuntime(8923):     at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source)
      01-17 10:01:17.685: E/AndroidRuntime(8923):     at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:279)
      01-17 10:01:17.685: E/AndroidRuntime(8923):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:669)
      01-17 10:01:17.685: E/AndroidRuntime(8923):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
      01-17 10:01:17.685: E/AndroidRuntime(8923):     at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
      01-17 10:01:17.685: E/AndroidRuntime(8923):     at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
      01-17 10:01:17.685: E/AndroidRuntime(8923):     at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
      01-17 10:01:17.685: E/AndroidRuntime(8923):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:272)
      01-17 10:01:17.685: E/AndroidRuntime(8923):     at android.app.Activity.setContentView(Activity.java:1835)
      01-17 10:01:17.685: E/AndroidRuntime(8923):     at com.him.mapfrag_rnd.MapFragActivity.onCreate(MapFragActivity.java:16)
      01-17 10:01:17.685: E/AndroidRuntime(8923):     at android.app.Activity.performCreate(Activity.java:4470)
      01-17 10:01:17.685: E/AndroidRuntime(8923):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1052)
      01-17 10:01:17.685: E/AndroidRuntime(8923):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
      01-17 10:01:17.685: E/AndroidRuntime(8923):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
      01-17 10:01:17.685: E/AndroidRuntime(8923):     at android.app.ActivityThread.access$600(ActivityThread.java:127)
      01-17 10:01:17.685: E/AndroidRuntime(8923):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
      01-17 10:01:17.685: E/AndroidRuntime(8923):     at android.os.Handler.dispatchMessage(Handler.java:99)
      01-17 10:01:17.685: E/AndroidRuntime(8923):     at android.os.Looper.loop(Looper.java:137)
      01-17 10:01:17.685: E/AndroidRuntime(8923):     at android.app.ActivityThread.main(ActivityThread.java:4511)
      01-17 10:01:17.685: E/AndroidRuntime(8923):     at java.lang.reflect.Method.invokeNative(Native Method)
      01-17 10:01:17.685: E/AndroidRuntime(8923):     at java.lang.reflect.Method.invoke(Method.java:511)
      01-17 10:01:17.685: E/AndroidRuntime(8923):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:986)
      01-17 10:01:17.685: E/AndroidRuntime(8923):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:753)
      01-17 10:01:17.685: E/AndroidRuntime(8923):     at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>when I make some changes in MapFragActivity.java, then map is displayed. here are the changes:</p>
  
  <pre><code>package com.him.mapfrag_rnd;
  
      import android.os.Bundle;
      import android.support.v4.app.FragmentActivity;
  
      import com.google.android.gms.maps.SupportMapFragment;
  
      public class MapFragActivity extends FragmentActivity {
  
          @Override
          public void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              //setContentView(R.layout.activity_map_frag);
            SupportMapFragment fragment = new SupportMapFragment();
            getSupportFragmentManager().beginTransaction().add(android.R.id.content, fragment).commit();
          }
      }
  </code></pre>
  
  <p>The change I have done is commented the setContentView.
  I have followed all the required steps and still I am getting and error. if uncomment the setContentView() then again I get the error.</p>
  
  <p>Please HELP!!!</p>