diff --git a/source/AndroidResolver/src/PlayServicesResolver.cs b/source/AndroidResolver/src/PlayServicesResolver.cs index 10215769..63310762 100644 --- a/source/AndroidResolver/src/PlayServicesResolver.cs +++ b/source/AndroidResolver/src/PlayServicesResolver.cs @@ -2468,7 +2468,7 @@ internal static string CopyAssetAndLabel(string sourceLocation, string targetLoc } var targetDir = Path.GetDirectoryName(targetLocation); - if (!FileUtils.CreateFolder(targetDir)) { + if (!FileUtils.CreateFolder(targetDir, logger)) { return String.Format("Failed to create folders at {0}", targetDir); } diff --git a/source/VersionHandlerImpl/src/FileUtils.cs b/source/VersionHandlerImpl/src/FileUtils.cs index 5c1c9c2d..6f3b098f 100644 --- a/source/VersionHandlerImpl/src/FileUtils.cs +++ b/source/VersionHandlerImpl/src/FileUtils.cs @@ -639,7 +639,7 @@ internal static bool IsValidGuid(string guidStr) { /// /// Path to the file/directory that needs checking. /// True if all folders are created successfully. - public static bool CreateFolder(string path) { + public static bool CreateFolder(string path, Google.Logger logger = null) { if (AssetDatabase.IsValidFolder(path)) { return true; } @@ -656,6 +656,20 @@ public static bool CreateFolder(string path) { return true; } + if (logger != null) { + logger.Log( + String.Format( + "Please ignore Unity error messages similar to '{0}'.\n" + + "Unable to use Unity API `AssetDatabase.CreateFolder()` to " + + "create folder: '{1}'. Switch to use `Directory.CreateDirectory()` " + + "instead. \n\n" + + "See {2} for more information.", + "*** is not a valid directory name.", + path, + "https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-7046"), + LogLevel.Info); + } + return Directory.CreateDirectory(path) != null; }