title: Android/Java - Can't set ad size
body: <p>I am trying to use AdMob in Android and am following tutorials. I have successfully downloaded, installed and added the Google Play Services library. Nearly everything seems fine.</p>
  
  <p>However Eclipse stubbornly gives a red underline under the "adView.setAdSize" bit. The error message says "The method setAdSize(AdSize) in the type AdView is not applicable for the arguments (AdSize)". I don't see what's wrong, that code is in line with all tutorials and documentation I can find, and why would setAdSize(AdSize) not take in AdSize as an argument? That doesn't make sense to me.</p>
  
  <p>Unfortunately setting the ad size is necessary for the code to run so I can't just remove that bit. Relevant code is below. Thanks to anyone that can help.</p>
  
  <pre><code>...
  import com.google.ads.AdSize;
  import com.google.android.gms.ads.AdRequest;
  import com.google.android.gms.ads.AdView;
  
  public class MainActivity extends ActionBarActivity{
      private AdView adView;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          ...
  
          // Create the adView.
          adView = new AdView(this);
          adView.setAdSize(AdSize.SMART_BANNER);
          adView.setAdUnitId("ID REMOVED FOR PRIVACY REASONS");
  
          ...
      }
  ...
  }
  </code></pre>