title: Importing Google-Play-Services in the android project removes R file
body: <p>While trying to use google maps v2 for application as suggested by <a href="https://developers.google.com/maps/documentation/android/start#installing_the_google_maps_android_v2_api/" rel="nofollow">this link</a> i went about the procedure to get the key and then followed the <a href="http://developer.android.com/google/play-services/setup.html" rel="nofollow">procedure </a> for importing google play service.But when i import the library in my project i find R file is missing. Can anyone suggest how this error can be solved.</p>
  
  <p><strong>EDIT</strong> </p>
  
  <p>Code and the log cat for it.</p>
  
  <pre><code>public class Maptest extends FragmentActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.maplayout);
      }
  }
  </code></pre>
  
  <p>XML FIle:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&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"
    class="com.google.android.gms.maps.MapFragment"/&gt;
  </code></pre>
  
  <p>and then the permission given in the manifest file </p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.VIBRATE"/&gt;
  &lt;uses-permission android:name="android.permission.CAMERA"/&gt;
  &lt;uses-permission android:name="android.permission.WAKE_LOCK"/&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
  &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&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;permission
        android:name="com.curioussolutions.autoistdiary.permission.MAPS_RECEIVE"
        android:protectionLevel="signature"/&gt;
      &lt;uses-permission android:name="com.curioussolutions.autoistdiary.permission.MAPS_RECEIVE"/&gt;
  
    &lt;uses-feature
          android:glEsVersion="0x00020000"
          android:required="true"/&gt;
  </code></pre>
  
  <p><code>02-20 10:30:16.093: E/AndroidRuntime(21076): FATAL EXCEPTION: main
  02-20 10:30:16.093: E/AndroidRuntime(21076): java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable
  02-20 10:30:16.093: E/AndroidRuntime(21076):    at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source)
  02-20 10:30:16.093: E/AndroidRuntime(21076):    at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source)
  02-20 10:30:16.093: E/AndroidRuntime(21076):    at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:271)
  02-20 10:30:16.093: E/AndroidRuntime(21076):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
  02-20 10:30:16.093: E/AndroidRuntime(21076):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
  02-20 10:30:16.093: E/AndroidRuntime(21076):    at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
  02-20 10:30:16.093: E/AndroidRuntime(21076):    at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
  02-20 10:30:16.093: E/AndroidRuntime(21076):    at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
  02-20 10:30:16.093: E/AndroidRuntime(21076):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:209)
  02-20 10:30:16.093: E/AndroidRuntime(21076):    at android.app.Activity.setContentView(Activity.java:1657)
  02-20 10:30:16.093: E/AndroidRuntime(21076):    at com.curioussolutions.autoistdiary.MainActivity.onCreate(MainActivity.java:25)
  02-20 10:30:16.093: E/AndroidRuntime(21076):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
  02-20 10:30:16.093: E/AndroidRuntime(21076):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
  02-20 10:30:16.093: E/AndroidRuntime(21076):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
  02-20 10:30:16.093: E/AndroidRuntime(21076):    at android.app.ActivityThread.access$1500(ActivityThread.java:117)
  02-20 10:30:16.093: E/AndroidRuntime(21076):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
  02-20 10:30:16.093: E/AndroidRuntime(21076):    at android.os.Handler.dispatchMessage(Handler.java:99)
  02-20 10:30:16.093: E/AndroidRuntime(21076):    at android.os.Looper.loop(Looper.java:130)
  02-20 10:30:16.093: E/AndroidRuntime(21076):    at android.app.ActivityThread.main(ActivityThread.java:3687)
  02-20 10:30:16.093: E/AndroidRuntime(21076):    at java.lang.reflect.Method.invokeNative(Native Method)
  02-20 10:30:16.093: E/AndroidRuntime(21076):    at java.lang.reflect.Method.invoke(Method.java:507)
  02-20 10:30:16.093: E/AndroidRuntime(21076):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
  02-20 10:30:16.093: E/AndroidRuntime(21076):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
  02-20 10:30:16.093: E/AndroidRuntime(21076):    at dalvik.system.NativeStart.main(Native Method)
  02-20 10:30:17.500: W/jdwp(21076): Debugger is telling the VM to exit with code=1
  02-20 10:30:17.500: I/dalvikvm(21076): GC lifetime allocation: 2194 bytes</code></p>