Go-ethereum: Go Ethereum Mobile (Android) Contract ABI Error

Created on 21 Apr 2017  路  9Comments  路  Source: ethereum/go-ethereum

System information

Geth version: 1.6.0
OS & Version: Android
Commit hash :

I do not know if it is my issue, or if it is go ethereum mobile, but raising this issue could help me. I already tried it on stackoverflow.

I want to interact with a Smart Contract in Ethereum from a mobile Device (here Android). The Smart Contract is working fine with the Javascript API from ethereum. So I want to use the Go Ethereum Mobile Client (1.6.0) (included by gradle). I could connect to the blockchain, getting a peer count, reading balances, but interacting with a contract is my problem.

Generating the Java-Class with the commandline-tool "abigen" is fine. I only have to change "bool" to "boolean", and the class should be ready to go. Whenever I try to interact, Go Ethereum is throwing an exception at: this.Contract.call()

Expected behaviour

Call contract function

Actual behaviour

throwing Error (Universe proxy)

Steps to reproduce the behaviour

Please see details on stackoverflow:
http://stackoverflow.com/questions/43298324/go-ethereum-mobile-android-contract-abi-error

Backtrace

calling constant function:
go.Universe$proxyerror: getString abi: cannot use invalid as type ptr as argument
calling functions:
go.Universe$proxyerror: argument count mismatch: 1 for 2

Most helpful comment

@nthtson you save me

All 9 comments

Thanks for the detailed report. The code generator is quite old and people have been mucking around with the abi package since, to it might happen that something got out of sync (mobile being experimental it's not thoroughly tested). I'll take a look.

@akamarukiba did you find a workaround?

@ligi no sorry, i have not found any workaround yet. I would like to publish my project, but not in this alpha stage :(

If you find any solution, i would appreciate it really much. I already spent really much time on this issue, before even raising it.

too bad @akamarukiba - thanks for the info - hope @karalabe finds some time to look over this again - sounded like he has an idea about the cause of this issue.

@ligi I am also looking forward to the next reply from @karalabe

Still nothing? I also have this issue

@akamarukiba: go.Universe$proxyerror: argument count mismatch: 1 for 2

Please go to: https://github.com/ethereum/go-ethereum/blob/master/mobile/bind.go#L168

You can try to replace this line from:
rawTx, err := c.contract.Transact(&opts.opts, method, args.objects)
to
rawTx, err := c.contract.Transact(&opts.opts, method, args.objects...)
Then rebuild mobile package (geth.aar) again.

@karalabe : Could you please take a look on it?

@nthtson you save me

Should be fixed on master now. Thanks @ligi!

Was this page helpful?
0 / 5 - 0 ratings