Web3j: why RemoteFunctionCall cannot resolved in 4.2.0-android?

Created on 12 Nov 2019  路  6Comments  路  Source: web3j/web3j

titile

org.web3j.protocol.core.RemoteFunctionCall cannot resolved in 4.2.0-android.

description

I use the web3j solidity gennerate cmd try to gennerate a java-class to transfer ERC-20 tokens,but some api not found that looks like version incompatible.

step:
  • copy the contract code form etherscan.io
  • $ solcjs USDP.sol --bin --abi --optimize -o .
  • $ web3j solidity generate --javaTypes -b ~/USDP_sol_TetherToken.bin -a ~/USDP_sol_TetherToken.abi -o ~ -p com.test.mywallet.stablecoin.eth.usdt
  • copy it to my project.

anyone can help me?

awaiting-user-input needs-review

Most helpful comment

I actually had this error myself.
What I found I had to do was be sure to include in my build.gradle file implementation('org.web3j:core:4.5.6').
This will have to be placed in your dependencies location.
Also, as a side note, be sure to enable the permissions for internet access in your andoridManifest.xml file.
It seems like your wrapper web3j command is correct.

All 6 comments

I actually had this error myself.
What I found I had to do was be sure to include in my build.gradle file implementation('org.web3j:core:4.5.6').
This will have to be placed in your dependencies location.
Also, as a side note, be sure to enable the permissions for internet access in your andoridManifest.xml file.
It seems like your wrapper web3j command is correct.

@parcool is this still an issue?

@parcool is this still an issue?

I think it is, just tried and seems to be missing from 4.2.0-android

I has the same issue when using only "org.web3j:core:4.2.0-android"

Same problem I am also facing.

I think the problem is that I used the web3j cli to generate the smart contract in java.
and web3j cli version is 4.5.16. but the android version is 4.2.x (tried on both 4.2.1 and 4.2.0)

So, i was trying to run the
https://docs.web3j.io/smart_contracts/#solidity-smart-contract-wrappers
commands in java ... (which is not available in 4.2.1)

how should i write the commands properly in the java code?

This issue is no longer relevant as the latest android version is 4.6.0 therefore this should be fixed. If however, the issue persists please create a new issue.

Was this page helpful?
0 / 5 - 0 ratings