title: Android Studio adding rxjava library
body: <p>Consider following project structure:</p>
  
  <pre><code>MainProject
  -.idea
  -.grandle
  -src
  -SubProject
  --libs //I created this folder manually
  ---rxjava-core-0.16.0-sources.jar
  --src
  ---main //+ all the sources
  --build.grandle
  --SubProject.iml
  -build.grandle
  -//other files
  </code></pre>
  
  <p>I downloaded the .jar from <a href="http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.rxjava%22%20AND%20a%3A%22rxjava-core%22" rel="noreferrer">http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.rxjava%22%20AND%20a%3A%22rxjava-core%22</a> (sources.jar) - but I also tried others</p>
  
  <p>Then I created lib folder in the SubProject and then put the .jar to it.</p>
  
  <p>In Android Studio I rightclicked on the library and selected "Add as Library..."
  with level: "Project Library" and module: "SubProject".</p>
  
  <p>The rxjava uses package name "rx".I have some code implemented that imports this package:</p>
  
  <pre><code>import rx.Observable;
  import rx.Observer;
  import rx.Subscription;
  import rx.subscriptions.Subscriptions;
  </code></pre>
  
  <p>When building the project following error occure:</p>
  
  <pre><code>Gradle: package rx does not exist
  Gradle: package rx.util.functions does not exist
  Gradle: cannot find symbol class Action1
  ...
  </code></pre>
  
  <p>I found that it is required to put a line to SubProject/build.grandle:</p>
  
  <pre><code>dependencies {
      compile 'libs/rxjava-core-0.16.0-sources.jar' //added line
      compile 'com.android.support:support-v4:19.0.0'
      compile 'com.android.support:appcompat-v7:19.0.0'
  }
  </code></pre>
  
  <p>but then it throws:</p>
  
  <pre><code>Gradle: A problem occurred evaluating project ':SubProject'.
  &gt; The description libs/rxjava-core-0.16.0-sources.jar is invalid
  </code></pre>
  
  <p>I tried to moving the .jar around the project structure but so far no luck. </p>
  
  <p>How do I properly add a 3rd party library to the project? Is it ok that I created the "libs" folder myself?</p>