Hi there,
I know there are already quite a few discussions about building Unity Android apps with Speckle send/receive functionality but since all these discussions suggest the same solution and this solution doesn’t work I wanted to start a new discussion based on my observations so far.
We want to include Speckle in a Mixed Reality-App for Meta Quest 3 and other Android-based platforms. At the moment we don’t use the standard Unity Connector components but custom made components which basically use the Operations.Receive()
method as in the ManualReceive
class (from the Speckle Unity sample project) and suggested by you in previous discussions like here.
There you made the correct assumption that the error is caused by the SQLite Transport which is used by default when no other type of Transport is provided for the localTransport
property. Providing a MemoryTransport
object does resolve this issue but another IOException
is thrown now. Using adb logcat
allows us to see the exception and some of its stack trace:
IOException: Read-only file system at System.IO.FileSystem.CreateDirectory (System.String fullPath) [0x00000] in <00000000000000000000000000000000>:0 at System.IO.Directory.CreateDirectory (System.String path) [0x00000] in <00000000000000000000000000000000>:0 at Speckle.Core.Helpers.SpecklePathProvider.EnsureFolderExists (System.String basePath, System.String folderName) [0x00008] in C:\Users\circleci\project\Core\Core\Helpers\Path.cs:155 at Speckle.Core.Helpers.SpecklePathProvider.get_UserSpeckleFolderPath () [0x0000a] in C:\Users\circleci\project\Core\Core\Helpers\Path.cs:45 at Speckle.Core.Helpers.SpecklePathProvider.LogFolderPath (System.String hostApplicationName, System.String hostApplicationVersion) [0x00000] in C:\Users\circleci\project\Core\Core\Helpers\Path.cs:166 at Speckle.Core.Logging.SpeckleLog.CreateConfiguredLogger (System.String hostApplicationName, System.String hostApplicationVersion, Speckle.Core.Logging.SpeckleLogConfiguration logConfiguration) [0x00011] in C:\Users\circ
As you can see here, the Stack Trace is incomplete and the file paths shown are garbage (“C:\Users\circleci\project\Core\Core\Helpers\Path.cs” ← this is not a valid path. Neither on the used Android device, nor on the Windows computer where the Application was built on).
But whats interesting here, is that you can see, that the SpeckleLog class seems to cause the exception. It tries to write all logs to a log file, which obviously isn’t allowed on Android. I don’t know where it tries to write the log file to since you dynamically try to build this path based on the platform. Logging to a file is by default enabled in the SpeckleLogConfiguration, but I can’t find where you create the SpeckleLog and set it’s config.