0

I have been trying to use stockfish in my android studio project and the only problem that I seem to face is that I can't run it.

`String filePath = context.getFilesDir() + File.pathSeparator + "StockfishEngine/stockfish_15.1_android_armv7/stockfish.android.armv7";

// String filePath = "StockfishEngine/stockfish_15.1_android_armv7/stockfish.android.armv7";

builder = new ProcessBuilder(filePath);

builder.redirectErrorStream(true); stockfishProcess = builder.start();`

My armv7 stockfish file is found in Assets folder.

No matter what I tried, it kept saying it cannot find the file and I can't just use getAssets().open(...) because then I'll get the input stream, not a process running stockfish actually. In the end, it keeps raising an error stating that it cannot find the file.

CXKX
  • 1
  • 1
  • Seems you have to put the file into jniLibs/armeabi-v7a see this post https://stackoverflow.com/questions/64786837/what-path-to-put-executable-to-run-on-android-29 – zomega Mar 17 '23 at 16:06
  • Thank you :) I'll try it and see if that helps although they say in that post that it related more to permission error while in my case the file could not be found error. – CXKX Mar 17 '23 at 18:50
  • The error message reported by Android can be wrong. It can be a permission issue even if Android says the file was not found. – zomega Mar 17 '23 at 19:14

0 Answers0