I have a project with several subprojects, I have ...
# gradle
z
I have a project with several subprojects, I have a
common
subproject that contains an interface used in each subproject to keep the design consistent, the problem im having is I want to only use this interface in my own code, it should not be used outside of my library source code. I do not want this common module in the publication
Copy code
interface Library {
    fun version(): Int

    fun configuration(): String

    fun license(): String
}
My implementation class for each subproject all say the same kind of error:
Cannot access 'dev.zt64.ffmpegkt.Library' which is a supertype of 'dev.zt64.ffmpegkt.avformat.AVFormat'. Check your module classpath for missing or conflicting dependencies
In the subproject i just have
implementation(project(":common"))
Is there something I can do?
t
Does your
Library
interface has
internal
visibility?
z
I can't make it internal cause then the subprojects depending on it can't use it
t
then some repro is needed. Could be classpath ordering issue or something else. Hard to say.
v
Not really. It's most likely happening in a consumer of the project with
AVFormat
. As
Library
is a superclass / interface, it is part of the public API and thus has to be
api
, not
implementation
, or the compiler chokes with exactly that message.
At least that is how it looks with Java in that situation