Access denied (0x80004005) on Process.Start() in android app

Viewed 1720

When I try to start new process, it finds a file to execute (as before it threw different exception), but throws an exception access denied. Here is a similar problem but only rights and permisions part makes sense to me from the answers that could be a problem. There was also an idea not to set RedirectStandardOutput to true for purpose of finding the error, so I disabled this row. Do I need some special permissions, manifest entries or whatever similar to enable starting new process from my app on android?

This is my code:

try
{
    string strToFolder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), fileName = "stockfish-8-armeabi-v7a";

    ProcessStartInfo psi = new ProcessStartInfo();
    psi.FileName = System.IO.Path.Combine(strToFolder, fileName);
    psi.UseShellExecute = false;
    psi.CreateNoWindow = true;
    psi.WorkingDirectory = strToFolder;
    //psi.RedirectStandardOutput = true;
    //psi.RedirectStandardError = true;

    stockfishProcess = new System.Diagnostics.Process();
    stockfishProcess.StartInfo = psi;
    stockfishProcess.Start();
}
catch (Exception e)
{
    string estr = e.ToString();
    initialized = false;
}

And this is the exception text

System.ComponentModel.Win32Exception (0x80004005): ApplicationName='/data/user/0/AlienChessAndroid.AlienChessAndroid/files/stockfish-8-armeabi-v7a', CommandLine='', CurrentDirectory='/data/user/0/AlienChessAndroid.AlienChessAndroid/files', Native error= Access denied at System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) [0x0018b] in /Users/builder/data/lanes/4009/3a62f1ea/source/mono/mcs/class/System/System.Diagnostics/Process.cs:737

2 Answers
Related