I am trying to read a file in my assets folder. The library is: Web3j's wallet utility class. I am not able to find the json file though. The json file is located in the assets folder but i can not find it.
currentWallet = WalletUtils.loadCredentials(password , "/some.json");
The stacktrace is as follows:
W/Java7Support: Unable to load JDK7 types (annotations, java.nio.file.Path): no Java7 support added
E/Main Activity: onCreate:
java.io.FileNotFoundException: keystore.json (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:146)
at com.fasterxml.jackson.core.JsonFactory.createParser(JsonFactory.java:756)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2740)
at org.web3j.crypto.WalletUtils.loadCredentials(WalletUtils.java:81)
at org.web3j.crypto.WalletUtils.loadCredentials(WalletUtils.java:76)
at mecreative.studio.liberaltoken.MainActivity.handleCreateContract(MainActivity.java:126)
at java.lang.reflect.Method.invoke(Native Method)
at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:288)
at android.view.View.performClick(View.java:6199)
at android.widget.TextView.performClick(TextView.java:11090)
at android.view.View$PerformClick.run(View.java:23647)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
Please help