realitycollective / realitytoolkit.dev

The development project for building the Reality Toolkit and its respective components
https://realitytoolkit.realitycollective.net/
MIT License
9 stars 0 forks source link

Bug: FileNotFoundException when trying to create a service on Mac with the service framework #45

Closed davisjc22 closed 2 years ago

davisjc22 commented 2 years ago

Reality Collective - Reality Toolkit Bug Report

Describe the bug

When I was trying to create my first service, I received an error in the Unity Console about not being able to locate a file in the reality collective service package. I'm following the tutorial on a Mac. I believe that this error is due to a forward slash / back slash issue in the file path name. I've included screenshots below of the error with the path, and where I believe this is occurring in the code.

To Reproduce

  1. Open Unity on a Mac.
  2. Install the reality collective service framework
  3. Create a service manager instance in the Unity scene
  4. Create a configuration profile on the service manager instance
  5. Create a service (Reality Collective > Service Framework > Create new service)
  6. See the issue in the console

Expected behavior

No error should be thrown when creating a service.

Actual behavior

The following error is being thrown:

System.IO.FileNotFoundException: Could not find file "/Users/connordavis/Documents/GitHub/Ethar/EtharImageTracking/Library/PackageCache/com.realitycollective.service-framework@1.0.0-preview.3\Editor\Templates~\IService.txt"
File name: '/Users/connordavis/Documents/GitHub/Ethar/EtharImageTracking/Library/PackageCache/com.realitycollective.service-framework@1.0.0-preview.3\Editor\Templates~\IService.txt'
  at 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) [0x0019e] in <775ba1b5e20140d4847e9ee0ddb18d84>:0 
  at 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) [0x00000] in <775ba1b5e20140d4847e9ee0ddb18d84>:0 
  at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions)
  at System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, System.Boolean detectEncodingFromByteOrderMarks, System.Int32 bufferSize) [0x00055] in <775ba1b5e20140d4847e9ee0ddb18d84>:0 
  at System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, System.Boolean detectEncodingFromByteOrderMarks) [0x00000] in <775ba1b5e20140d4847e9ee0ddb18d84>:0 
  at (wrapper remoting-invoke-with-check) System.IO.StreamReader..ctor(string,System.Text.Encoding,bool)
  at System.IO.File.InternalReadAllText (System.String path, System.Text.Encoding encoding) [0x00000] in <775ba1b5e20140d4847e9ee0ddb18d84>:0 
  at System.IO.File.ReadAllText (System.String path) [0x0002c] in <775ba1b5e20140d4847e9ee0ddb18d84>:0 
  at RealityCollective.ServiceFramework.Editor.ServiceWizard.GenerateInterface (System.String newInterfaceName, System.Collections.Generic.List`1[T] usingList) [0x0003c] in /Users/connordavis/Documents/GitHub/Ethar/EtharImageTracking/Library/PackageCache/com.realitycollective.service-framework@1.0.0-preview.3/Editor/ServiceWizard.cs:343 
  at RealityCollective.ServiceFramework.Editor.ServiceWizard.<OnGUI>b__26_0 () [0x0009a] in /Users/connordavis/Documents/GitHub/Ethar/EtharImageTracking/Library/PackageCache/com.realitycollective.service-framework@1.0.0-preview.3/Editor/ServiceWizard.cs:210 
UnityEngine.Debug:LogError (object)

Screenshots

The issue: image

The code that is likely causing the issue: image

Your Setup

SimonDarksideJ commented 2 years ago

Thanks for the report @davisjc22 and apologies for taking so long to comment. We do love and support our mac brethren :D