{"record":{"id":"fb21758a8ec6c4a7","repo":"JosefNemec/Playnite","slug":"cannot-package-theme-unsupported-api-version-dete","errorCode":null,"errorMessage":"Cannot package theme. Unsupported API version detected: {themeApiVer}","messagePattern":"Cannot package theme\\. Unsupported API version detected: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"source/Tools/Playnite.Toolbox/Themes.cs","lineNumber":192,"sourceCode":"            var manifestPath = Path.Combine(themeDirectory, PlaynitePaths.ThemeManifestFileName);\r\n            if (!File.Exists(manifestPath))\r\n            {\r\n                throw new Exception($\"Manifest file ({PlaynitePaths.ThemeManifestFileName}) not found!\");\r\n            }\r\n\r\n            var extInfo = ExtensionInstaller.GetThemeManifest(manifestPath);\r\n            if (extInfo.Id.IsNullOrEmpty())\r\n            {\r\n                throw new Exception(\"Cannot package theme, ID is missing!\");\r\n            }\r\n\r\n            extInfo.VerifyManifest();\r\n\r\n            var apiVer = extInfo.Mode == ApplicationMode.Desktop ? ThemeManager.DesktopApiVersion : ThemeManager.FullscreenApiVersion;\r\n            var themeApiVer = Version.Parse(extInfo.ThemeApiVersion);\r\n            if (themeApiVer > apiVer)\r\n            {\r\n                throw new Exception($\"Cannot package theme. Unsupported API version detected: {themeApiVer}\");\r\n            }\r\n            else if (themeApiVer != apiVer)\r\n            {\r\n                logger.Warn(\"Selected theme has not been updated to the latest supported API version. Please consider updating the theme!\");\r\n                logger.Warn(\"https://github.com/JosefNemec/Playnite/issues/1259\");\r\n            }\r\n\r\n            var defaultThemeDir = Path.Combine(Paths.GetThemesPath(mode), \"Default\");\r\n            targetPath = Path.Combine(targetPath, $\"{Common.Paths.GetSafePathName(extInfo.Id).Replace(' ', '_')}_{extInfo.Version.ToString().Replace(\".\", \"_\")}{PlaynitePaths.PackedThemeFileExtention}\");\r\n            FileSystem.PrepareSaveFile(targetPath);\r\n            using (var zipStream = new FileStream(targetPath, FileMode.Create))\r\n            {\r\n                using (var zipFile = new ZipArchive(zipStream, ZipArchiveMode.Create))\r\n                {\r\n                    zipFile.CreateEntryFromFile(manifestPath, PlaynitePaths.ThemeManifestFileName);\r\n\r\n                    foreach (var file in Directory.GetFiles(themeDirectory, \"*.*\", SearchOption.AllDirectories))\r\n                    {\r","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/JosefNemec/Playnite/blob/5911f4e964e628aa7a69c2030ab35101afa63067/source/Tools/Playnite.Toolbox/Themes.cs#L174-L210","documentation":"Thrown by Themes.PackageTheme when the theme's declared ThemeApiVersion is strictly greater than the API version Toolbox supports for the theme's Mode (DesktopApiVersion or FullscreenApiVersion). This is a forward-incompatibility guard: a theme built against a newer Playnite API than the installed Toolbox cannot be safely packaged. A lower/different version only logs a warning, not an error.","triggerScenarios":"theme.yaml ThemeApiVersion (e.g. 1.5.0) exceeds ThemeManager.DesktopApiVersion or ThemeManager.FullscreenApiVersion baked into this Toolbox build. Occurs when a theme is developed against a newer Playnite and packaged with an older Toolbox.","commonSituations":"Playnite upgraded but Toolbox not updated (stale Toolbox binary); theme copied from a newer Playnite into an older install; Version.Parse quirks where ThemeApiVersion in theme.yaml is malformed yet parses higher than expected.","solutions":["Update Toolbox to a build whose ThemeManager API versions are >= the theme's ThemeApiVersion.","Lower theme.yaml ThemeApiVersion to match the supported API (only if the theme does not actually use newer APIs).","Confirm ThemeApiVersion is a valid System.Version string (e.g. `1.4.0`) — Version.Parse is strict about format.","Ensure Mode in theme.yaml matches the API family you intend (Desktop vs Fullscreen use different API versions)."],"exampleFix":"// before (theme.yaml)\nThemeApiVersion: 1.7.0   # Toolbox only supports up to 1.4.0\n\n// after\nThemeApiVersion: 1.4.0","handlingStrategy":"validation","validationCode":"var supportedApi = mode == ApplicationMode.Desktop ? ThemeManager.DesktopApiVersion : ThemeManager.FullscreenApiVersion;\nvar themeApi = Version.Parse(man.ThemeApiVersion);\nif (themeApi > supportedApi)\n    throw new InvalidOperationException($\"Theme API {themeApi} exceeds supported {supportedApi}; update Toolbox.\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep Toolbox and Playnite in lockstep so ThemeManager API versions stay current.","Pin theme.yaml ThemeApiVersion to the API you actually target.","Validate ThemeApiVersion parses as a System.Version before packaging."],"tags":["themes","packaging","versioning","compatibility","toolbox"],"backgroundTag":null,"analyzedSha":"5911f4e964e628aa7a69c2030ab35101afa63067","analyzedAt":"2026-08-13T17:38:25.713Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}