Java module does not have `api` and should use` compile`?

As stated in https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#new_configurations , now we have apiand implementation.

In the ie Android module apply plugin: 'com.android.application', we have both.

However, in the simple ie Java module apply plugin: 'java'(used by my Android application module) I could only find implementation, but not api.

Therefore, in one of the dependent I must use compileand can not use api.
Is it apiunavailable on a Java module?

+4
source share
1 answer

You should use:

apply plugin: 'java-library'

The key difference between the standard Java plugin and the Java library plugin is that the latter introduces an API concept that is provided to consumers .

The plugin provides two configurations that can be used to declare dependencies: apiandimplementation .

More info here.

+2
source

Source: https://habr.com/ru/post/1685281/


All Articles