title: How do I use com.google.firebase.database classes in a Java (not Android) library?
body: <p>I have an Android Studio project in which I have three modules:</p>
  
  <ul>
  <li><code>app</code>: An Android app</li>
  <li><code>model</code>: A Java library containing my POJOs that get persisted to Firebase Database</li>
  <li><code>service</code>: An App Engine web application with a servlet that persists some stuff to Firebase Database</li>
  </ul>
  
  <p>Both the <code>service</code> and the <code>app</code> modules depend on the <code>model</code> module. The <code>model</code> module doesn't depend on either the <code>app</code> or the <code>service</code>.</p>
  
  <p>The <code>model</code> module contains only POJOs, but I've just found myself needing to use the <code>com.google.firebase.database.Exclude</code> annotation in order to prevent a field from being written to the database. As soon as I add a compile dependency to either the Firebase admin or the Firebase server SDK to my <code>module</code> project and rebuild, my app crashes before it gets as far as logging anything.</p>
  
  <p>I've tried using these dependencies in the <code>model</code> module (one at a time, not both at once):</p>
  
  <pre><code>compile 'com.google.firebase:firebase-admin:4.0.3'
  
  compile 'com.google.firebase:firebase-server-sdk:3.0.1'
  </code></pre>
  
  <p>My guess is that they're both pulling in a bunch of stuff that doesn't belong in an Android app. I've also tried:</p>
  
  <pre><code>compile 'com.google.firebase:firebase-database:10.0.1'
  </code></pre>
  
  <p>But that gives me a gradle error:</p>
  
  <pre><code>Error:Module 'biketracker-android-service:model:unspecified' depends on one or more Android Libraries but is a jar
  </code></pre>
  
  <p>Is there a library I can use that gives me just the bare minimum Firebase Database classes and is not an Android library?</p>