I've done web search for "plugin request for plugin already on the classpath must not include a version site:stackoverflow.com" and found nothing that particular. Search for "plugin request for plugin already on the classpath must not include a version" (w/out SO) found: https://discuss.gradle.org/t/error-plugin-already-on-the-classpath-must-not-include-a-version/31814 where I've read in answers e.g.:
I didn’t find any reference to this use case in Grade plugins documentation.
The error
Build file '/Users/username/github/OpCon/app/build.gradle' line: 4 Error resolving plugin [id: 'com.android.application', version: '3.4.1']
Plugin request for plugin already on the classpath must not include a version
appears in IntelliJ IDEA
, build.gradle (OpCon):
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
app/build.gradle
:
plugins {
id 'com.android.application' version '3.4.1' apply true
}
... and then other stuff
I don't understand, classpath 'com.android.tools.build:gradle:3.5.2' does not seem to include 'com.android.application'... "classpath" has only one occurrence if searched in the project.
ADDED:
Interestingly on https://maven.google.com/web/index.html I can find 'com.android.tools.build:gradle:3.5.2' but no 'com.android.application' branch.
ADDED 2: I've downloaded (quite many files actually was downloaded for some reason) by command taken from here How can I download a specific Maven artifact in one command line?:
mvn org.apache.maven.plugins:maven-dependency-plugin:2.8:get -DrepoUrl='https://maven.google.com/' -Dartifact='com.android.tools.build:gradle:3.4.1'
found path com.android.tools.build:gradle
in file manager and looked inside only jar there:
username$ jar tvf /Users/username/.m2/repository/com/android/tools/build/gradle/3.4.1/gradle-3.4.1.jar | grep application
1115 Wed May 01 20:30:18 MSK 2019 com/android/build/gradle/internal/tasks/ApplicationIdWriterTask$applicationIdSupplier$1.class
55 Wed May 01 20:29:18 MSK 2019 META-INF/gradle-plugins/com.android.application.properties
So there is a mention gradle plugin
com.android.application
in jar META-INF
.
File com.android.application.properties
is one liner: implementation-class=com.android.build.gradle.AppPlugin
.
Web search for "implementation class java" finds info on interfaces. In wiki https://en.wikipedia.org/wiki/Interface_(Java):
An interface in the Java programming language is an abstract type that is used to specify a behavior that classes must implement.
So gradle plugin could be an interface? How can I dig in further?