title: java.lang.NoClassDefFoundError on Android with GoogleAccountCredential.newChooseAccountIntent()
body: <p>I am developing for Android 4+ with Eclipse Juno ADT bundle + Google Plugin for Eclipse.
  I need to programmatically log into a google account to use the Google Calendar API. For
  this I am making use of account manager. I get the following error:</p>
  
  <pre><code>05-05 13:28:55.605: E/AndroidRuntime(11186): FATAL EXCEPTION: main
  05-05 13:28:55.605: E/AndroidRuntime(11186): java.lang.NoClassDefFoundError: com.google.android.gms.common.AccountPicker
  05-05 13:28:55.605: E/AndroidRuntime(11186):    at com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential.newChooseAccountIntent(GoogleAccountCredential.java:171)
  05-05 13:28:55.605: E/AndroidRuntime(11186): ...
  </code></pre>
  
  <p>Here is the code that causes it:</p>
  
  <pre><code>GoogleAccountCredential credential;
  
  credential = GoogleAccountCredential.usingOAuth2(this, CalendarScopes.CALENDAR);
  
  chooseAccount();
  
  private void chooseAccount() {
  
    startActivityForResult(credential.newChooseAccountIntent(), REQUEST_ACCOUNT_PICKER);
  
  }
  </code></pre>
  
  <p>I have searched stackoverflow for solutions. The libs directory contains the calendar
  library files for eclipse I imported via google plugin for eclipse (which also put
  there the authentication etc... libraries):</p>
  
  <pre><code>android-support-v4.jar
  google-api-client-1.14.1-beta.jar
  google-api-client-android-1.14.1-beta.jar
  google-api-services-calendar-v3-rev41-1.14.2-beta.jar
  google-http-client-1.14.1-beta.jar
  google-http-client-android-1.14.1-beta.jar
  google-http-client-gson-1.14.1-beta.jar
  google-http-client-jackson-1.14.1-beta.jar
  google-http-client-jackson2-1.14.1-beta.jar
  google-oauth-client-1.14.1-beta.jar
  gson-2.1.jar
  jackson-core-2.1.3.jar
  jackson-core-asl-1.9.11.jar
  jsr305-1.3.9.jar
  </code></pre>
  
  <p>These however do not seem to include</p>
  
  <pre><code>com.google.android.gms.common.AccountPicker
  </code></pre>
  
  <p>If I import this in my code the import line of code is flagged as an error.
  So what's up. I've copied this code from the Google Calendar Sample where it
  runs just fine:</p>
  
  <p><a href="http://samples.google-api-java-client.googlecode.com/hg/calendar-android-sample/" rel="nofollow noreferrer">http://samples.google-api-java-client.googlecode.com/hg/calendar-android-sample/</a></p>
  
  <p>That code has exactly the same libs except:</p>
  
  <ol>
  <li>calendar lib is rev33 instead of rev41</li>
  <li>jackson and jackson-asl libraries are missing</li>
  <li>.properties file for each library file present in sample code but not in my code</li>
  </ol>
  
  <p>So this should not be the problem. However,
  looking in the imports section of the code, the google calendar sample code has:</p>
  
  <pre><code>import com.google.android.gms.common.GooglePlayServicesUtil;
  </code></pre>
  
  <p>but if I try to insert this line of code in my code it is tagged as an error
  saying the import com.google.android.gms.common.GooglePlayServicesUtil
  cannot be resolved.</p>
  
  <p>This post</p>
  
  <p><a href="https://stackoverflow.com/questions/14790149/java-lang-noclassdeffounderror-com-google-android-gms-common-accountpicker">java.lang.NoClassDefFoundError: com.google.android.gms.common.AccountPicker</a></p>
  
  <p>says they were able to</p>
  
  <pre><code>import com.google.android.gms.common.AccountPicker;
  </code></pre>
  
  <p>But I'd like to know what library that came from.</p>
  
  <p>I even tried looking in the original android calendar sample for the
  library from which I can include com.google.android.gms.common.*
  by inspecting one file at a time but could not find it. How
  is it possible?</p>
  
  <p>What am I doing wrong?</p>
  
  <p>Thanks very very much for all your help.</p>