Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No compatible solc release could be found for the file: #68

Open
imdsc opened this issue Jun 9, 2021 · 11 comments
Open

No compatible solc release could be found for the file: #68

imdsc opened this issue Jun 9, 2021 · 11 comments

Comments

@imdsc
Copy link

imdsc commented Jun 9, 2021

image

my solidity file:
pragma solidity ^0.8.0;

@xaviarias
Copy link
Contributor

Hi, could you give more context?

  • OS: Linux, MacOS, Windows?
  • Plugin version
  • Project POM

Thanks

@imdsc
Copy link
Author

imdsc commented Jun 10, 2021

@xaviarias
OS: Windows 10 Home 2004(19041.985)
Plugin version: 4.8.2
maven version:Apache Maven 3.8.1


4.0.0

<groupId>org.imdsc</groupId>
<artifactId>blockchain</artifactId>
<version>1.0-SNAPSHOT</version>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.3.1.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
    <maven.compiler.source>8</maven.compiler.source>
    <maven.compiler.target>8</maven.compiler.target>
</properties>

<dependencies>

    <!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>5.0.0</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-mail</artifactId>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi</artifactId>
        <version>5.0.0</version>
    </dependency>

    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <optional>true</optional>
    </dependency>

    <!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
    <dependency>
        <groupId>com.alibaba</groupId>
        <artifactId>fastjson</artifactId>
        <version>1.2.68</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <!-- https://mvnrepository.com/artifact/com.baomidou/mybatis-plus-boot-starter -->
    <dependency>
        <groupId>com.baomidou</groupId>
        <artifactId>mybatis-plus-boot-starter</artifactId>
        <version>3.4.0</version>
    </dependency>

    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <scope>runtime</scope>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.web3j</groupId>
        <artifactId>core</artifactId>
        <version>4.8.4</version>
    </dependency>

    <dependency>
        <groupId>com.squareup.okhttp3</groupId>
        <artifactId>okhttp</artifactId>
        <version>4.9.0</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.jasypt/jasypt -->
    <dependency>
        <groupId>org.jasypt</groupId>
        <artifactId>jasypt</artifactId>
        <version>1.9.3</version>
    </dependency>

</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.web3j</groupId>
            <artifactId>web3j-maven-plugin</artifactId>
            <version>4.8.2</version>
            <configuration>
                <packageName>org.blockchain.contract</packageName>
                <soliditySourceFiles>
                    <directory>src/main/resources</directory>
                    <includes>
                        <include>**/*.sol</include>
                    </includes>
                </soliditySourceFiles>
            </configuration>
        </plugin>
    </plugins>
</build>

@Fredi100
Copy link

Fredi100 commented Aug 3, 2021

I ran into a simillar problem. Go to C:\Users\<User>\.web3j\solc and check the releases.json file. There should be an entry with the desired solidity version. Check if a valid windows_url is provided. For me it wasn't so the plugin was not able to download the needed version as it does not know from where. You can manually download the desired version and place it alongside the other installed versions in C:\Users\<User>\.web3j\solc

@KamilBemowskiGFT
Copy link

It doesn't work, I'd like to use version 0.8.4 and I downloaded the version from this link: https://github.com/ethereum/solidity/releases/download/v0.8.4/solc-windows.exe and put that file to the directory C:\Users<User>.web3\solc\0.8.4 but still doesn't work with the same result. Do you have any idea?

@it-honghui
Copy link

I ran into a simillar problem.After version 0.7.1, windows_url lacks the corresponding mapping, how can I solve it?

@novakorr
Copy link

novakorr commented Dec 7, 2021

encountering a similar issue, any update on this?

@N4YC
Copy link

N4YC commented Dec 14, 2021

You just have to mention in your solidity contract this line pragma solidity >=0.7.0 <0.9.0;.
This issue can be explained by the solidity version choose for your OS. It works fine on Windows for the 0.7.1 of solidity.
You can't use a recent version because of the solc-windows.zip instead of solc-windows.exe which changes the way it works.

@adpe adpe mentioned this issue Mar 31, 2022
@doumuxie
Copy link

doumuxie commented Sep 15, 2022

如果sol版本编译超过0.7.1,就会出现上述问题,原因是因为 web3j会先从本地 C:\Users<User>.web3j\solc\release.json 获取最新的windows可用url,在 maven web3j 4.9.4 版本中,引入了子依赖 web3j-sokt 0.2.1, 在源代码 https://github.com/web3j/web3j-sokt/blob/release/0.2.1/src/main/kotlin/org/web3j/sokt/VersionResolver.kt 中可用看到 从 https://internal.services.web3labs.com/api/solidity/versions/ 下载了 release.json 文件,但是文件中从 0.7.1 之后windows_url一直为 “”, 所以无法找到合适的编译版本solc。
image

在 web3j-sokt 0.2.2 中 https://github.com/web3j/web3j-sokt/blob/release/0.2.2/src/main/kotlin/org/web3j/sokt/VersionResolver.kt ,release.json 的下载地址变更为 https://raw.githubusercontent.com/web3j/web3j-sokt/master/src/main/resources/releases.json ,截至目前文件内的最新可用版本为 solidity 0.8.13

所以我认为解决方案应该是 maven 排除 web3j-sokt 0.2.1, 引入新的 web3j-sokt 0.2.2.

@zhang988925
Copy link

zhang988925 commented Nov 11, 2022

<plugin>
	<groupId>org.web3j</groupId>
	<artifactId>web3j-maven-plugin</artifactId>
	<version>4.9.4</version>
	<dependencies>
		<dependency>
			<groupId>org.web3j</groupId>
			<artifactId>web3j-sokt</artifactId>
			<version>0.2.2</version>
		</dependency>
	</dependencies>
</plugin>

@bububear
Copy link

<plugin>
	<groupId>org.web3j</groupId>
	<artifactId>web3j-maven-plugin</artifactId>
	<version>4.9.4</version>
	<dependencies>
		<dependency>
			<groupId>org.web3j</groupId>
			<artifactId>web3j-sokt</artifactId>
			<version>0.2.2</version>
		</dependency>
	</dependencies>
</plugin>

我配置了 web3j-sokt 0.2.2. 但是不生效。请问有遇到这样的情况吗?

@bububear
Copy link

bububear commented Apr 19, 2023

<plugin>
	<groupId>org.web3j</groupId>
	<artifactId>web3j-maven-plugin</artifactId>
	<version>4.9.4</version>
	<dependencies>
		<dependency>
			<groupId>org.web3j</groupId>
			<artifactId>web3j-sokt</artifactId>
			<version>0.2.2</version>
		</dependency>
	</dependencies>
</plugin>

我配置了 web3j-sokt 0.2.2. 但是不生效。请问有遇到这样的情况吗?

已解决;
解决方案供参考:

  1. 下载插件源码,解压缩,导入IDEA ,修改 web3j-sokt 依赖版本。
  2. 执行 mvn clean install

最后刷新依赖项目maven仓库,即可。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants