knowm / XChange

XChange is a Java library providing a streamlined API for interacting with 60+ Bitcoin and Altcoin exchanges providing a consistent interface for trading and accessing market data.
http://knowm.org/open-source/xchange/
MIT License
3.84k stars 1.94k forks source link

[bitfinex] Deserialization issue on Android #3246

Open tiagoferraro opened 4 years ago

tiagoferraro commented 4 years ago

line where the error is triggered exchange = ExchangeFactory.INSTANCE.createExchange( BitfinexExchange::class.java.name,APIKEY,SECRET)

Log error W/System.err: org.knowm.xchange.exceptions.ExchangeException: si.mazi.rescu.HttpStatusIOException: Cannot deserialize value of type java.math.BigDecimal from String "tBTCUSD": not a valid representation at [Source: (StringReader); line: 1, column: 3] (through reference chain: java.lang.Object[][0]->org.knowm.xchange.bitfinex.v2.dto.marketdata.BitfinexTicker["ask"]) W/System.err: at org.knowm.xchange.BaseExchange.applySpecification(BaseExchange.java:117) at org.knowm.xchange.ExchangeFactory.createExchange(ExchangeFactory.java:78)

walec51 commented 4 years ago

just merged a PR that might help, please build the latest snapshot on your machine and test against it

walec51 commented 4 years ago

closing due to lack of response

GusWard commented 4 years ago

@walec51 I am still getting this issue on Android, seems to be attempting to parse the 'symbol' as a BigDecimal. Could this be something to do with a mismatched parsing library?

msgilligan commented 4 years ago

I'm seeing this issue on Android, too. (Using minSdkVersion 28 and targetSdkVersion 29)

veken0m commented 4 years ago

I get the same issue on Android.

@GusWard Are you able to clean up your pull request so that it can be merged? The @JsonPropertyOrder fix resolves the issue because for some reason Android deserializes the properties in alphabetical order by default.

walec51 commented 3 years ago

I'm wondering does this library even work on Android after we moved to Java 11?