{"record":{"id":"090610e85cdfd9c0","repo":"CoplayDev/unity-mcp","slug":"package-exporting-failed-provided-export-paths-ar","errorCode":null,"errorMessage":"Package Exporting failed: provided export paths are empty or only contain empty folders","messagePattern":"Package Exporting failed: provided export paths are empty or only contain empty folders","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"TestProjects/AssetStoreUploads/Packages/com.unity.asset-store-tools/Editor/Exporter/LegacyPackageExporter.cs","lineNumber":45,"sourceCode":"            if (_legacyExportSettings.ExportPaths == null || _legacyExportSettings.ExportPaths.Length == 0)\r\n                throw new ArgumentException(\"Export paths array cannot be empty\");\r\n        }\r\n\r\n        protected override async Task<PackageExporterResult> ExportImpl()\r\n        {\r\n            return await this.Export();\r\n        }\r\n\r\n        private async new Task<PackageExporterResult> Export()\r\n        {\r\n            ASDebug.Log(\"Using native package exporter\");\r\n\r\n            try\r\n            {\r\n                var guids = GetGuids(_legacyExportSettings.ExportPaths, out bool onlyFolders);\r\n\r\n                if (guids.Length == 0 || onlyFolders)\r\n                    throw new ArgumentException(\"Package Exporting failed: provided export paths are empty or only contain empty folders\");\r\n\r\n                string exportMethod = ExportMethodWithoutDependencies;\r\n                if (_legacyExportSettings.IncludeDependencies)\r\n                    exportMethod = ExportMethodWithDependencies;\r\n\r\n                var split = exportMethod.Split('.');\r\n                var assembly = Assembly.Load(split[0]); // UnityEditor\r\n                var typeName = $\"{split[0]}.{split[1]}\"; // UnityEditor.PackageUtility\r\n                var methodName = split[2]; // ExportPackage or ExportPackageAndPackageManagerManifest\r\n\r\n                var type = assembly.GetType(typeName);\r\n                var method = type.GetMethod(methodName, BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public,\r\n                    null, new Type[] { typeof(string[]), typeof(string) }, null);\r\n\r\n                ASDebug.Log(\"Invoking native export method\");\r\n\r\n                method?.Invoke(null, new object[] { guids, _legacyExportSettings.OutputFilename });\r\n\r","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/CoplayDev/unity-mcp/blob/c21bf496bca87d54e75bad048563c3adb1782081/TestProjects/AssetStoreUploads/Packages/com.unity.asset-store-tools/Editor/Exporter/LegacyPackageExporter.cs#L27-L63","documentation":"Thrown after GetGuids resolves zero GUIDs from the export paths, or when the paths contain only empty folders. Unlike error 101 (which checks array emptiness), this fires when paths exist but yield no exportable Unity assets. It prevents creating an empty .unitypackage.","triggerScenarios":"GetGuids(_legacyExportSettings.ExportPaths, out bool onlyFolders) returns an empty array, or onlyFolders is true — meaning AssetDatabase found no assets (only empty directories) under the given paths.","commonSituations":"Export paths point to folders that contain only subfolders with no assets; assets were deleted or moved after paths were configured; .meta files exist but the actual asset files are missing; folders contain only ignored file types.","solutions":["Verify the export paths actually contain Unity-imported assets (check the AssetDatabase, not just the filesystem).","Remove or replace empty-only folders from ExportPaths.","Re-import the folder in Unity (right-click > Reimport) to ensure AssetDatabase has registered the assets."],"exampleFix":"// before\nvar guids = GetGuids(_legacyExportSettings.ExportPaths, out bool onlyFolders);\nif (guids.Length == 0 || onlyFolders)\n    throw new ArgumentException(\"Package Exporting failed: provided export paths are empty or only contain empty folders\");\n\n// after — report which paths are problematic\nvar guids = GetGuids(_legacyExportSettings.ExportPaths, out bool onlyFolders);\nif (guids.Length == 0 || onlyFolders)\n{\n    var empties = _legacyExportSettings.ExportPaths.Where(p => !AssetDatabase.FindAssets(\"\", new[] { p }).Any());\n    throw new ArgumentException($\"No assets found in: {string.Join(\", \", empties)}\");\n}","handlingStrategy":"validation","validationCode":"// Pre-check: verify paths contain actual assets before exporting\nforeach (var path in exportPaths)\n{\n    var guids = AssetDatabase.FindAssets(\"\", new[] { path });\n    if (guids.Length == 0)\n        Debug.LogWarning($\"Path '{path}' contains no assets and will cause export failure.\");\n}","typeGuard":null,"tryCatchPattern":"try\n{\n    await exporter.Export();\n}\ncatch (ArgumentException ex) when (ex.Message.Contains(\"empty or only contain empty folders\"))\n{\n    Debug.LogError(\"Export failed: the selected paths contain no assets. Verify your folders are not empty.\");\n}","preventionTips":["Verify each export path has assets via AssetDatabase.FindAssets before starting export.","Reimport folders that may have stale AssetDatabase entries.","Check for empty-only folders in the UI and warn the user before export."],"tags":["unity","asset-store-tools","validation","packaging","asset-database"],"backgroundTag":null,"analyzedSha":"c21bf496bca87d54e75bad048563c3adb1782081","analyzedAt":"2026-08-13T17:36:56.095Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}