{"record":{"id":"cc4cc351b0fd23cc","repo":"EllanJiang/GameFramework","slug":"resource-pack-0-is-not-exist","errorCode":null,"errorMessage":"Resource pack '{0}' is not exist.","messagePattern":"Resource pack '(.+?)' is not exist\\.","errorType":"validation","errorClass":"GameFrameworkException","httpStatus":null,"severity":"error","filePath":"GameFramework/Resource/ResourceManager.cs","lineNumber":1256,"sourceCode":"            m_CheckResourcesCompleteCallback = checkResourcesCompleteCallback;\n            m_ResourceChecker.CheckResources(m_CurrentVariant, ignoreOtherVariant);\n        }\n\n        /// <summary>\n        /// 使用可更新模式并应用资源包资源。\n        /// </summary>\n        /// <param name=\"resourcePackPath\">要应用的资源包路径。</param>\n        /// <param name=\"applyResourcesCompleteCallback\">使用可更新模式并应用资源包资源完成时的回调函数。</param>\n        public void ApplyResources(string resourcePackPath, ApplyResourcesCompleteCallback applyResourcesCompleteCallback)\n        {\n            if (string.IsNullOrEmpty(resourcePackPath))\n            {\n                throw new GameFrameworkException(\"Resource pack path is invalid.\");\n            }\n\n            if (!File.Exists(resourcePackPath))\n            {\n                throw new GameFrameworkException(Utility.Text.Format(\"Resource pack '{0}' is not exist.\", resourcePackPath));\n            }\n\n            if (applyResourcesCompleteCallback == null)\n            {\n                throw new GameFrameworkException(\"Apply resources complete callback is invalid.\");\n            }\n\n            if (m_ResourceMode == ResourceMode.Unspecified)\n            {\n                throw new GameFrameworkException(\"You must set resource mode first.\");\n            }\n\n            if (m_ResourceMode != ResourceMode.Updatable && m_ResourceMode != ResourceMode.UpdatableWhilePlaying)\n            {\n                throw new GameFrameworkException(\"You can not use ApplyResources without updatable resource mode.\");\n            }\n\n            if (m_ResourceUpdater == null)","sourceCodeStart":1238,"sourceCodeEnd":1274,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/Resource/ResourceManager.cs#L1238-L1274","documentation":"Thrown by ResourceManager.ApplyResources when the given resourcePackPath does not exist on disk (File.Exists returned false). The formatted message includes the offending path so the developer can see which file was expected.","triggerScenarios":"Calling ApplyResources with a path to a file that was never downloaded, was deleted between download and apply, uses the wrong filename/casing, or lives in a location the sandbox cannot see (e.g. relative path vs persistentDataPath).","commonSituations":"Applying a pack before its download completed; app update wiping persistent data; path casing/platform differences (iOS vs Android sandbox paths); hard-coded paths that differ per device.","solutions":["Verify File.Exists(packPath) before calling ApplyResources; if missing, re-download the pack.","Use Application.persistentDataPath-based absolute paths, not relative or hard-coded ones.","Log the exact path in the error to check for casing/format issues."],"exampleFix":"// before\nm_ResourceManager.ApplyResources(path, OnApplyComplete);\n// after\nif (File.Exists(path)) {\n    m_ResourceManager.ApplyResources(path, OnApplyComplete);\n} else {\n    DownloadPackThen(() => m_ResourceManager.ApplyResources(path, OnApplyComplete));\n}","handlingStrategy":"validation","validationCode":"if (string.IsNullOrEmpty(packPath) || !File.Exists(packPath)) {\n    ReDownloadResourcePack();\n    return;\n}\nm_ResourceManager.ApplyResources(packPath, onApplyComplete);","typeGuard":"bool PackFileExists(string p) => !string.IsNullOrEmpty(p) && File.Exists(p);","tryCatchPattern":"try { m_ResourceManager.ApplyResources(packPath, cb); } catch (GameFrameworkException ex) { Log.Error($\"Apply failed: {ex.Message}\"); ReDownloadResourcePack(); }","preventionTips":["Always build absolute paths from Application.persistentDataPath.","Confirm download completion and file existence before applying.","Re-download the pack when it is missing rather than reusing a stale path."],"tags":["unity","gameframework","file-not-found","resource-pack"],"backgroundTag":"file-not-found","analyzedSha":"d0c010b05167c58e92350449d04864a91ca13fd2","analyzedAt":"2026-09-15T13:37:15.352Z","contentChangedAt":"2026-09-15T13:37:15.352Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}