title: Add YouTube Data API to Android Studio
body: <p>So, I am currently messing around with android programming in my free time, and I am using android studio as my ide of choice.  I am currently trying to make a very simple app using the youtube api.  My issue is that I cant figure out how to actually get the api into my application.  I have used file>project structure to add the stuff to my application, but that doesnt work by itself.  It stops yelling at me about syntax errors but when it compiles it errors.</p>
  
  <p>I researched this a bit and have found that I need to add stuff to build.gradle or settings.gradle(or both) but i havent found a definitive answer on exactly what to do.  Everything I have tried thus far hasnt worked.  SO if someone could either explain to me what i have to do, or link me to a place where it explains what to do that would be great</p>
  
  <p>--edit--</p>
  
  <p>I am so confused right now.  I started a new project.  I added the libs and it was still able to compile.  I then added the imports and it threw errors about it.  I then added these to the build.gradle and it was able to compile perfectly</p>
  
  <pre><code>compile fileTree(dir: 'libs/youtube', include: '*.jar')
  compile fileTree(dir: 'libs/youtube/libs', include: '*.jar')
  </code></pre>
  
  <p>But when i added this code that requires the library</p>
  
  <pre><code>/** Global instance of the HTTP transport. */
  private static final HttpTransport HTTP_TRANSPORT = new NetHttpTransport();
  
  /** Global instance of the JSON factory. */
  private static final JsonFactory JSON_FACTORY = new JacksonFactory();
  
  /** Global instance of Youtube object to make all API requests. */
  private static YouTube youtube;
  </code></pre>
  
  <p>the syntax was fine but it threw an error upon compiling it</p>
  
  <pre><code> Gradle: Execution failed for task ':Apitest:dexDebug'.
  &gt; Failed to run command:
  </code></pre>
  
  <p>and that was followed by about 100 lines of of file locations</p>
  
  <p>Any ideas as to what i am doing wrong?</p>