android / android/project-replicator

Plugin requires Java 15

Open
#35 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
136
Forks
40
PR merge metrics
No merged PRs in 30d

Description

Kotlin 1.7.20
Android Gradle Plugin 7.3.1
Gradle 7.5.1

I have built the plugin to the local Maven repository and modified my project's main `build.gradle.kts` like this:
```
buildscript {
repositories {
mavenLocal()
google()
mavenCentral()
}
dependencies {
classpath("com.android.gradle.replicator:project-replicator:0.2")
classpath(libs.kotlin.pluginGradle)
classpath(libs.android.pluginGradle)
}
}

allprojects {
repositories {
google()
mavenCentral()

apply {
plugin("com.android.gradle.replicator.ProjectReplicatorPlugin")
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class) {
kotlinOptions.jvmTarget = JavaVersion.VERSION_11.toString()
}
}
```

However when syncing Gradle I get the following error:
```
> Could not determine the dependencies of null.
> Could not resolve all task dependencies for configuration ':classpath'.
> Could not resolve com.android.gradle.replicator:project-replicator:0.2.
Required by:
project :
> No matching variant of com.android.gradle.replicator:project-replicator:0.2 was found. The consumer was configured to find a runtime of a library compatible with Java 11, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.5.1' but:
- Variant 'apiElements' capability com.android.gradle.replicator:project-replicator:0.2 declares a library, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares an API of a component compatible with Java 15 and the consumer needed a runtime of a component compatible with Java 11
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '7.5.1')
- Variant 'runtimeElements' capability com.android.gradle.replicator:project-replicator:0.2 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component compatible with Java 15 and the consumer needed a component compatible with Java 11
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '7.5.1')
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the Gradle sync using the shown Kotlin 1.7.20, Android Gradle Plugin 7.3.1, Gradle 7.5.1, and Java 11 setup with the locally published project-replicator:0.2 plugin. Inspect the plugin's build configuration and published variant metadata to determine why it requires Java 15; done means the compatibility behavior is resolved or the Java requirement is explicitly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.