Replicate
On Linux, build a non-Android application as follows:
Install Gradle 7.3
Install JDK 17
Update PATH environment variable accordingly.
Open terminal
Run:
git clone https://github.com/DaveJarvis/keenwrite/
cd keenwrite
gradle clean jar
jar -tvf build/libs/keenwrite.jar | grep -i greenrobot | wc -l
Build is successful, 55 GreenRobot-related classes found.
Edit build.gradle.
Change the EventBus version from 3.2.0 to 3.3.1:
implementation 'org.greenrobot:eventbus:3.3.1'
Save the file.
Re-run gradle clean jar
Expected
A .jar file is built.
Actual
FAILURE: Build failed with an exception.
* Where:
Build file '.../keenwrite/build.gradle' line: 181
* What went wrong:
Could not determine the dependencies of task ':jar'.
> Could not resolve all files for configuration ':runtimeClasspath'.
> Could not resolve org.greenrobot:eventbus:3.3.1.
Required by:
project :
> No matching variant of org.greenrobot:eventbus:3.3.1 was found. The consumer was configured to find a runtime of a library compatible with Java 17, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally but:
- Variant 'releaseApiPublication' capability org.greenrobot:eventbus:3.3.1 declares a library, and its dependencies declared externally:
- Incompatible because this component declares an API of a component, with the library elements 'aar' and the consumer needed a runtime of a component, packaged as a jar
- Other compatible attributes:
- Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
- Doesn't say anything about its target Java version (required compatibility with Java 17)
- Variant 'releaseRuntimePublication' capability org.greenrobot:eventbus:3.3.1 declares a runtime of a library, and its dependencies declared externally:
- Incompatible because this component declares a component, with the library elements 'aar' and the consumer needed a component, packaged as a jar
- Other compatible attributes:
- Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
- Doesn't say anything about its target Java version (required compatibility with Java 17)
Replicate On Linux, build a non-Android application as follows:
Build is successful, 55 GreenRobot-related classes found.
build.gradle
.gradle clean jar
Expected A
.jar
file is built.Actual