title: R cannot be resolved to a variable & activity_main cannot be resolved or is not a field , xml is also ok but no file in gen folder
body: <p>i am new to android app development,</p>
  
  <p>i have just created simple android project, but when it created it shows error.</p>
  
  <p>"R cannot be resolved to a variable" when i press control shift +o</p>
  
  <p>android.R is automatically added to my code but now it shows this error </p>
  
  <p>"activity_main cannot be resolved or is not a field"</p>
  
  <p>this is code of this project </p>
  
  <pre><code>package com.php.helloworld;
  
  import android.R;
  import android.app.Activity;
  import android.os.Bundle;
  import android.view.Menu;
  
  
  public class MainActivity extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.main, menu);
          return true;
      }
  
  }
  </code></pre>
  
  <p>and when i tried to write this line </p>
  
  <p>import com.php.helloworld.R
  it shows "The import com.php.helloworld.R cannot be resolved"</p>
  
  <p>There is also no problem in my xml file and and there is no file in gen folder
  can somebody help me please to resolve this</p>