title: Cannot Access Class Using Java Language But Can Using Kotlin
body: <p>I am experiencing an issue regarding access of an abstract class.</p>
  
  <p>For background, I have an abstract class in a common module. The abstract class is just setters/getters for some values.</p>
  
  <pre><code>abstract class BaseConfiguration {
  
      abstract var key: String?
      abstract var token: String?
  }
  </code></pre>
  
  <p>The common module is used by another module that is a SDK. So, in gradle this common module is implemented.</p>
  
  <p>Gradle</p>
  
  <pre><code>implementation project(":common")
  </code></pre>
  
  <p>Inside of the SDK module, there are public interfaces to allow the setting/getting of the values in the BaseConfiguration file.</p>
  
  <p>The conflict I am running into is that for Kotlin everything works fine. I am able to create a project, then add the SDK as a dependency and then set values for the BaseConfiguration through the provided interfaces in the SDK.</p>
  
  <p>However, when I try to use the Java language, I am receiving a "cannot access BaseConfiguration" error. The only thing that seems to resolve this issue is to update my SDK gradle to api.</p>
  
  <p>Gradle Changes</p>
  
  <pre><code>api project(":common")
  </code></pre>
  
  <p>I have concerns with this change, because the common module is supposed to be internal and only used by the SDK. The app level should not have access to it. The app should only access the provided interfaces by the SDK. </p>
  
  <p>Does anyone know why this is working perfectly with Kotlin, but not with Java? What am I doing wrong? </p>
  
  <p>Further Notes:
  When decompiling the Kotlin to Java for the BaseConfiguration class it shows that everything is public.</p>
  
  <pre><code>public abstract class BaseConfiguration {
     @Nullable
     public abstract String getKey();
  
     public abstract void setKey(@Nullable String var1);
  
     @Nullable
     public abstract String getToken();
  
     public abstract void setToken(@Nullable String var1);
  }
  </code></pre>