- Home /
FTP error only in non-development builds
Hi all,
I am making an app that, among other things, uploads data to an FTP server. Part of this involves creating a new directory on the server. This works fine in the editor and in developmentbuilds on android - the code runs and the directory appears on the server. However any attempt to do this in a non-development android build fails to create the directory and throws this exception:
mono-io-layer-error (10013)
The code in question throwing the exception looks like this:
try
{
if (!directoryExits)
{
FtpWebRequest ftpRequest = (FtpWebRequest)WebRequest.Create(dirToCreate);
ftpRequest.Credentials = new NetworkCredential(userName, password);
ftpRequest.UseBinary = true;
ftpRequest.UsePassive = true;
ftpRequest.KeepAlive = true;
ftpRequest.Method = WebRequestMethods.Ftp.MakeDirectory;
FtpWebResponse ftpResponse = (FtpWebResponse)ftpRequest.GetResponse();
ftpResponse.Close();
}
}
catch (Exception ex)
{
result = "Error creating dir " + dirToCreate + " : " + ex.Message;
}
Searching online it looks like this error is to do with a malformed URL but, like I said, it works correctly in debug builds and in the editor, so I find this hard to believe. Still the url (the dirToCreate variable) looks like this:
*ftp://xxx.xxx.xxx.xxx:xx/volume(sda1)/Camera*
Does anyone know what might cause this?
Answer by Guy-Corbett · Jul 22, 2021 at 07:27 PM
Turns out I had Android internet permissions set to "Auto" in my Player Settings. Changing this to "Required" fixed it.
Your answer
Follow this Question
Related Questions
Unity 5.6 Video Clip stream on Android 0 Answers
Android development build opengl 1 Answer
Download data from FTP on Android 1 Answer
unchecking Development Build breaks cardboard app 0 Answers
Draw call minimizer 1 Answer