I'm trying to use web3j + Infura to interact with the Rinkeby chain from an android app. I first wrote a simple test in Java and everything worked - transactions, interacting with contracts, you name it. So I moved to Android, but in the emulator loading the credentials from file is taking forever + showing several garbage collection warnings, and on my Moto G5plus phone is actually crashing due to an OutOfMemoryError. This is what I am doing (in an AsyncTask):
Credentials credentials = WalletUtils.loadCredentials("notMyActualPassword", cacheFilePath);
The file path is correct, I do print the wallet file in my logs and it shows up correctly. The crash logs were copied into this gist.
Does anyone know why this might happen?