title: Android Studio: Add jar as library?
body: <p>I'm trying to use the new Android Studio but I can't seem to get it working correctly.</p>
  
  <p>I'm using the <strong>Gson</strong> library to serialize/deserialize JSON-objects. But the library somehow isn't included in the build.</p>
  
  <p>I had created a new project with just a <strong>MainActivity</strong>.
  Copied <strong>gson-2.2.3.jar</strong> in the /libs folder and added it as a library dependancy(right click->Add as library). This includes the jar in android studio so it can be referenced from the source files.</p>
  
  <p>When I try to run the project it cannot compile so I added:</p>
  
  <pre><code>compile files('libs/gson-2.2.3.jar')
  </code></pre>
  
  <p>to the dependencies in de .gradle file. After that it compiles correctly but when running the application I get a <code>ClassDefNotFoundException</code>.</p>
  
  <p>Does anyone know what I'm doing wrong?</p>