XRTK / com.xrtk.core

The Official Mixed Reality Framework for Unity
https://xrtk.io
MIT License
309 stars 34 forks source link

Configuring the XRTK in a new project raises UnauthorizedAccessException exception #614

Closed SimonDarksideJ closed 4 years ago

SimonDarksideJ commented 4 years ago

XRTK - Mixed Reality Toolkit Bug Report

Describe the bug

In new projects, or with fresh configuration, the editor reports UnauthorizedAccessException errors in the console. This doesn't happen for all files, only a single one for each package (but may simply stop at the first)

Likely cause is the files are maybe trying to copy twice, as all the files mentioned are already present and copied

To Reproduce

New Project

  1. Create a new project
  2. Use the XRTK seed package to install XRTK
  3. Upgrade XRTK to the latest preview
  4. Install the latest SDK preview
  5. Observe the profile copy after the package installed
  6. See error in console

Existing Project

  1. Open Project project
  2. Upgrade XRTK to the latest preview
  3. Install/upgrade the latest SDK preview
  4. Close the project and delete the library folder from root and the XRTK.Generated from assets
  5. Re-open the project
  6. Use the "Mixed Reality Toolkit -> Packages -> Install XRTK.SDK package assets...
  7. See error in console after copy complete

Expected behavior

No Errors

Actual behavior

Below error is logged to the console, the same happens for all the other packages which have assets to copy.

Your Setup

Additional context

Full error as follows

UnauthorizedAccessException: Access to the path "C:\LocalDevelopment\XRTKTesting\XRTK_Preview_Testing_1\Assets\XRTK.Generated\SDK\Profiles\CameraSystem.meta" is denied.
System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) (at <7d97106330684add86d080ecf65bfe69>:0)
System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options, System.String msgPath, System.Boolean bFromProxy, System.Boolean useLongPath, System.Boolean checkHost) (at <7d97106330684add86d080ecf65bfe69>:0)
(wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions,string,bool,bool,bool)
System.IO.StreamWriter.CreateFile (System.String path, System.Boolean append, System.Boolean checkHost) (at <7d97106330684add86d080ecf65bfe69>:0)
System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize, System.Boolean checkHost) (at <7d97106330684add86d080ecf65bfe69>:0)
System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize) (at <7d97106330684add86d080ecf65bfe69>:0)
System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding) (at <7d97106330684add86d080ecf65bfe69>:0)
(wrapper remoting-invoke-with-check) System.IO.StreamWriter..ctor(string,bool,System.Text.Encoding)
System.IO.File.WriteAllText (System.String path, System.String contents, System.Text.Encoding encoding) (at <7d97106330684add86d080ecf65bfe69>:0)
System.IO.File.WriteAllText (System.String path, System.String contents) (at <7d97106330684add86d080ecf65bfe69>:0)
XRTK.Editor.Utilities.GuidRegenerator.RegenerateGuidsInternal (System.Collections.Generic.List`1[T] assetsRootPath) (at Library/PackageCache/com.xrtk.core@0.2.0-preview.69/Editor/Utilities/GuidRegenerator.cs:139)
XRTK.Editor.Utilities.GuidRegenerator.RegenerateGuids (System.Collections.Generic.List`1[T] assetsRootPath, System.Boolean refreshAssetDatabase) (at Library/PackageCache/com.xrtk.core@0.2.0-preview.69/Editor/Utilities/GuidRegenerator.cs:42)
XRTK.Editor.PackageInstaller.TryInstallAssets (System.Collections.Generic.Dictionary`2[TKey,TValue] installationPaths, System.Boolean regenerateGuids) (at Library/PackageCache/com.xrtk.core@0.2.0-preview.69/Editor/PackageInstaller.cs:120)
XRTK.SDK.Editor.SDKPackageInstaller.CheckPackage () (at Library/PackageCache/com.xrtk.sdk@0.2.0-preview.10/Editor/SDKPackageInstaller.cs:47)
UnityEditor.EditorApplication.Internal_CallDelayFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:209)
StephenHodgson commented 4 years ago

Are you installing the preview packages by default?

I suggest installing only the previews and not upgrading to the latest from anything prev to 0.2.0

The latest seed package installer from the release downloads should have the preview toggle

SimonDarksideJ commented 4 years ago

It happens even if I'm only using the previews, as described in the "Existing project" replication steps

StephenHodgson commented 4 years ago

Both examples sound like they're moving from 0.1 to 0.2. Just want to clarify

StephenHodgson commented 4 years ago

Also, what existing project are you using? Is this something you can share so I can better understand your setup?

SimonDarksideJ commented 4 years ago

Replication 1 is from 0.1 to 0.2 effectively as it starts with the 0.1 seed, but the scene / toolkit is NOT configured. The packages are simply updated prior to use, as stated in the replication steps.

And AS STATED in the replication steps, this is a clean, brand new project with no content.

StephenHodgson commented 4 years ago

Why are you installing the 0.1 packages then moving to 0.2 when the seed provides a way to cleanly install the 0.2 previews?

SimonDarksideJ commented 4 years ago

@FejZa can you attempt to replicate this issue as Stephen is having troubles getting the error.

Mine is a completely brand new installation, so should be representative of what most people will have.

StephenHodgson commented 4 years ago

I don't think most people are installing the 0.1 release and upgrading to 0.2.

For existing projects I might suggest removing the xrtk then doing a clean install of 0.2?