{"record":{"id":"d2f05cd1994c72a7","repo":"CoplayDev/unity-mcp","slug":"input-path-inputpath-is-not-a-valid-adb-folder","errorCode":null,"errorMessage":"Input path '{inputPath}' is not a valid ADB folder","messagePattern":"Input path '(.+?)' is not a valid ADB folder","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"TestProjects/AssetStoreUploads/Packages/com.unity.asset-store-tools/Editor/Previews/Scripts/Generators/Custom/TypeGenerators/TypePreviewGeneratorBase.cs","lineNumber":32,"sourceCode":"        public TypeGeneratorSettings Settings { get; }\r\n\r\n        public abstract event Action<int, int> OnAssetProcessed;\r\n\r\n        public TypePreviewGeneratorBase(TypeGeneratorSettings settings)\r\n        {\r\n            Settings = settings;\r\n        }\r\n\r\n        public virtual void ValidateSettings()\r\n        {\r\n            if (Settings.InputPaths == null || Settings.InputPaths.Length == 0)\r\n                throw new ArgumentException(\"Input path cannot be null\");\r\n\r\n            foreach (var path in Settings.InputPaths)\r\n            {\r\n                var inputPath = path.EndsWith(\"/\") ? path.Remove(path.Length - 1) : path;\r\n                if (!AssetDatabase.IsValidFolder(inputPath))\r\n                    throw new ArgumentException($\"Input path '{inputPath}' is not a valid ADB folder\");\r\n            }\r\n\r\n            if (string.IsNullOrEmpty(Settings.OutputPath))\r\n                throw new ArgumentException(\"Output path cannot be null\");\r\n        }\r\n\r\n        public async Task<List<PreviewMetadata>> Generate()\r\n        {\r\n            var generatedPreviews = new List<PreviewMetadata>();\r\n            ValidateSettings();\r\n\r\n            var assets = CollectAssets();\r\n            assets = FilterIgnoredAssets(assets);\r\n\r\n            if (assets.Count() == 0)\r\n                return generatedPreviews;\r\n\r\n            return await GenerateImpl(assets);\r","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/CoplayDev/unity-mcp/blob/c21bf496bca87d54e75bad048563c3adb1782081/TestProjects/AssetStoreUploads/Packages/com.unity.asset-store-tools/Editor/Previews/Scripts/Generators/Custom/TypeGenerators/TypePreviewGeneratorBase.cs#L14-L50","documentation":"Thrown when AssetDatabase.IsValidFolder returns false for one of the input paths in TypePreviewGeneratorBase.ValidateSettings. Each path is stripped of a trailing slash, then checked against the AssetDatabase (not the filesystem) — meaning the folder must be inside the Unity project and imported. A path that exists on disk but not in ADB still fails.","triggerScenarios":"Iterating Settings.InputPaths in ValidateSettings: for each path, a trailing slash is removed, then AssetDatabase.IsValidFolder(inputPath) returns false.","commonSituations":"Path points to a folder outside the Unity project (e.g., an absolute system path); folder was deleted or moved after being selected; folder exists on disk but hasn't been imported by Unity yet; path has a typo or uses backslashes on Windows; folder is inside the project but under a .gitignore'd or hidden directory.","solutions":["Ensure each InputPath is a relative path inside the Assets/ folder (e.g., 'Assets/MyFolder').","Verify the folder exists in the Project window (which reflects ADB state), not just in the file explorer.","If the folder was recently created, trigger an AssetDatabase.Refresh() before validation.","Normalize path separators and remove trailing slashes before passing paths to settings."],"exampleFix":"// before\nvar settings = new TextureTypeGeneratorSettings { InputPaths = new[] { \"/home/user/textures\", \"C:/Textures\" }, ... };\n\n// after\nvar settings = new TextureTypeGeneratorSettings { InputPaths = new[] { \"Assets/Textures\" }, ... };","handlingStrategy":"validation","validationCode":"foreach (var path in settings.InputPaths)\n{\n    var cleanPath = path.TrimEnd('/');\n    if (!AssetDatabase.IsValidFolder(cleanPath))\n        Debug.LogError($\"'{cleanPath}' is not a valid AssetDatabase folder. Ensure it is inside the Assets/ directory.\");\n}\n// Trigger refresh if folders may be stale\nAssetDatabase.Refresh();","typeGuard":"static bool AreAllInputPathsValidADB(string[] paths)\n    => paths != null && paths.Length > 0 && paths.All(p => AssetDatabase.IsValidFolder(p.TrimEnd('/')));","tryCatchPattern":"try\n{\n    await generator.Generate();\n}\ncatch (ArgumentException ex) when (ex.Message.Contains(\"not a valid ADB folder\"))\n{\n    Debug.LogError($\"Invalid input folder: {ex.Message}. Use paths relative to the project (e.g., 'Assets/MyFolder').\");\n}","preventionTips":["Use only relative paths inside the Assets/ folder for InputPaths.","Call AssetDatabase.Refresh() after creating new folders before preview generation.","Validate folders through the Project window, not the filesystem explorer.","Normalize path separators and remove trailing slashes."],"tags":["unity","asset-store-tools","preview","validation","asset-database","path"],"backgroundTag":null,"analyzedSha":"c21bf496bca87d54e75bad048563c3adb1782081","analyzedAt":"2026-08-13T17:36:56.095Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}