After upgrading to Android Studio 3.0 we also must use the new android gradle plugin
com.android.tools.build:gradle:3.0.0-alpha1
and we should be able to use the
java-library gradle plugin (instead of the java plugin) for java-only modules.
But this does not work: see tag java-library-plugin
The problem was in the gradle version. Updading to version 4.0-milestone-2
fixed the issue changes
Working tag: java-library-plugin-OK
see also: