title: Failed to resolve project: Android library and Java library module dependency
body: <p>I'm trying to create a project which includes an Android library and a Java library in Android Studio (3.1). The Java library depends on the Android library. Both are modules in my project like this:</p>
  
  <pre><code>MyProject    
  |-android
  |-java
  </code></pre>
  
  <p>Both appear in settings.gradle:</p>
  
  <pre><code>include ':android', ':java'
  </code></pre>
  
  <p>And the Java library depends on the Android library like this:</p>
  
  <p>java (<code>build.gradle</code>):</p>
  
  <pre><code>apply plugin: 'java-library'
  
  dependencies {
      implementation fileTree(dir: 'libs', include: ['*.jar'])
      implementation project(':android')
  }
  ...
  </code></pre>
  
  <p>android (<code>build.gradle</code>):</p>
  
  <pre><code>apply plugin: 'com.android.library'
  ...
  </code></pre>
  
  <p>When trying to sync the project I'm getting the following error:</p>
  
  <blockquote>
    <p>Failed to resolve: project::android</p>
  </blockquote>
  
  <p>Why?</p>
  
  <p><strong>P.S.</strong> The other way around (Android depending on Java) works just fine.</p>