I fall into this issue before but still cannot solve it.
I change the way to parse block data.
Run bitcoin-qt or bitcoind and parse the raw block from rpc server. In the config file bitcoin.conf you must put this line:
rpcserialversion=0 => this will keep the raw block output in the same format with previous version.