alpha-wallet-android icon indicating copy to clipboard operation
alpha-wallet-android copied to clipboard

Diagnose API23 crash issue

Open JamesSmartCell opened this issue 3 years ago • 1 comments

Zero in on the web3j code that is crashing when we use API23.

  1. Reproduce: Ran an API23 emulator and run the app. It will crash, probably in ticker service when it tries to call the smart contract.
  2. Make it work: Use an older version of web3j (maybe 4.6.0-android or 4.2.1-android). You will have to remove the web3j library dependency and restore the web3j import from Maven. You may have to resolve (or remove eg the 1559 transactions).
  3. Make it work using the local web3j builds. Use this repo: https://github.com/AlphaWallet/web3j follow the build instructions and copy the abi library into the alpha-wallet-android project.
  4. Work out which part of web3j is the culprit, and see if it's possible to back-port just that code (that is, a mix of the forked web3j on the AW repo and the old web3j source).

This may be just a write-up, but ultimately if you can solve the issue it would be very valuable.

JamesSmartCell avatar Jun 02 '22 20:06 JamesSmartCell

@JamesSmartCell

  • As api 23 doesnt support most of java8 features I had to use web3j-3.3.1-android. I updated it with the additional code required in AW. There are 2-3 minor code updates in AW.
  • We only need to use the web3j:core module as it uses java8 code. Other modules are from AW web3j repo and they work fine. Also need to rename the core jar from core-3.3.1 to core-4.8.8 due to gradle error - not sure why.
  • Fixed crashes using modded web3j-3.3.1-android with additional classes and methods from Web3j-4.8.8-android required by AW
  • Modded Web3j-3.3.1: https://github.com/asif-finimble/web3j-AW-backPort

asif-finimble avatar Jul 04 '22 12:07 asif-finimble