Skip to content

Conversation

@dellis1972
Copy link
Contributor

@dellis1972 dellis1972 commented Apr 11, 2018

Fixes #1541

We missed one area in the changes where we worked around
the WorkingDirectory issues. We were not using the full path
to create the directory where the java R.java files are output.
As a result we ended up with the following error

	Error        Access to the path 'obj\Debug\monoandroid81\android\src' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
   at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
   at System.IO.Directory.CreateDirectory(String path)
   at Xamarin.Android.Tasks.Aapt.GenerateCommandLineCommands(String ManifestFile, String currentAbi, String currentResourceOutputFile)
   at Xamarin.Android.Tasks.Aapt.ProcessManifest(ITaskItem manifestFile)

Once again this is due to the working directory changing in the
thread that we are using.

So the solution is to use the full path to create the folder.
In theory because we use the WorkingDirectory on the process
we should NOT need to pass the full path as the command line
argument. While that might be a safer option we might well run into
issues were we exceed the max path or max command line length on
windows.

… directory.

Fixes dotnet#1541

We missed one area in the changes where we worked around
the WorkingDirectory issues. We were not using the full path
to create the directory where the java R.java files are output.
As a result we ended up with the following error

	Error        Access to the path 'obj\Debug\monoandroid81\android\src' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
   at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
   at System.IO.Directory.CreateDirectory(String path)
   at Xamarin.Android.Tasks.Aapt.GenerateCommandLineCommands(String ManifestFile, String currentAbi, String currentResourceOutputFile)
   at Xamarin.Android.Tasks.Aapt.ProcessManifest(ITaskItem manifestFile)

Once again this is due to the working directory changing in the
thread that we are using.

So the solution is to use the full path to create the folder.
In theory because we use the `WorkingDirectory` on the process
we should NOT need to pass the full path as the command line
argument. While that might be a safer option we might well run into
issues were we exceed the max path or max command line length on
windows.
@dellis1972 dellis1972 added this to the d15-7 milestone Apr 11, 2018
@dellis1972 dellis1972 requested a review from jonpryor April 11, 2018 11:06
@dellis1972
Copy link
Contributor Author

It has been confirmed by a customer that this PR fixes the issue reported.

@dellis1972 dellis1972 added regression vs-sync For internal use only; creates a VSTS "mirror" issue. labels Apr 11, 2018
@jonpryor jonpryor merged commit 7418105 into dotnet:master Apr 11, 2018
@dellis1972 dellis1972 removed the vs-sync For internal use only; creates a VSTS "mirror" issue. label Apr 11, 2018
jonpryor pushed a commit that referenced this pull request Apr 11, 2018
… directory. (#1542)

Fixes: #1541

We missed one area in the changes where we worked around the
WorkingDirectory issues (45efffe): we were not using the full path
to create the directory where the java `R.java` files are output.
As a result we ended up with the following error:

	Error        Access to the path 'obj\Debug\monoandroid81\android\src' is denied.
	   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
	   at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
	   at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
	   at System.IO.Directory.CreateDirectory(String path)
	   at Xamarin.Android.Tasks.Aapt.GenerateCommandLineCommands(String ManifestFile, String currentAbi, String currentResourceOutputFile)
	   at Xamarin.Android.Tasks.Aapt.ProcessManifest(ITaskItem manifestFile)

Once again this is due to the working directory changing in the
thread that we are using.

So the solution is to use the full path to create the folder. In
theory because we use the `WorkingDirectory` on the process we should
NOT need to pass the full path as the command line argument. While
that might be a safer option we might well run into issues were we
exceed the max path or max command line length on Windows.
@github-actions github-actions bot locked and limited conversation to collaborators Feb 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants