web3j icon indicating copy to clipboard operation
web3j copied to clipboard

Could not set unknown property 'outputDir' for Main Solidity Sources of type org.gradle.api.internal.file.DefaultSourceDirectorySet.

Open iirekm opened this issue 1 year ago • 5 comments

I'm getting

> Failed to apply plugin class 'org.web3j.solidity.gradle.plugin.SolidityPlugin'.
   > Could not set unknown property 'outputDir' for Main Solidity Sources of type org.gradle.api.internal.file.DefaultSourceDirectorySet.

The code:

buildscript {
    repositories {
        maven("https://artifacts.consensys.net/public/maven/maven/")
    }
}

plugins {
    kotlin("jvm") version "1.9.23"
    id("org.web3j") version "4.11.2"
}

Tested Gradle versions: 8.4, 8.7

iirekm avatar Apr 18 '24 15:04 iirekm

Workaround competitive plugin id("io.github.ehdrbs0318.lazy3j") version "1.0.4" seems to work

iirekm avatar Apr 18 '24 15:04 iirekm

Same here:

An exception occurred applying plugin request [id: 'org.web3j', version: '4.11.3']
> Failed to apply plugin class 'org.web3j.solidity.gradle.plugin.SolidityPlugin'.
   > Could not set unknown property 'outputDir' for Main Solidity Sources of type org.gradle.api.internal.file.DefaultSourceDirectorySet.

gradle 8.7, java 17

AlexOreshkevich avatar May 03 '24 12:05 AlexOreshkevich

Looks to be an issue when using a gradle version >= 8.0

Quote from https://docs.gradle.org/7.6/javadoc/org/gradle/api/file/SourceDirectorySet.html#setOutputDir:

setOutputDir @Deprecated void setOutputDir​(Provider<java.io.File> provider) Deprecated. Use getDestinationDirectory().set() instead. This method will be removed in Gradle 8.0. Sets the provider that gives the directory to assemble the compiled classes into. Parameters: provider - provides output directory for this source directory set Since: 4.0

bradbown avatar May 03 '24 13:05 bradbown

Same here:

An exception occurred applying plugin request [id: 'org.web3j', version: '4.11.3']
> Failed to apply plugin class 'org.web3j.solidity.gradle.plugin.SolidityPlugin'.
   > Could not set unknown property 'outputDir' for Main Solidity Sources of type org.gradle.api.internal.file.DefaultSourceDirectorySet.

gradle 8.7, java 17

Yes it is due to incompatibility with gradle version >=8.5. We are working on updating all web3j repos to gradle 8.5

NickSneo avatar May 13 '24 12:05 NickSneo

Reopen this as the issue persists

gtebrean avatar Feb 13 '25 14:02 gtebrean