{"record":{"id":"9a3e4ed8d228417b","repo":"egametang/ET","slug":"can-t-find-xxxx-xcodeproj-project-pbxproj-in-path","errorCode":null,"errorMessage":"can't find xxxx.xcodeproj/project.pbxproj in {pathToBuiltProject}","messagePattern":"can't find xxxx\\.xcodeproj/project\\.pbxproj in (.+?)","errorType":"exception","errorClass":"BuildFailedException","httpStatus":null,"severity":"error","filePath":"Packages/cn.etetet.hybridclr/Scripts/Editor/Share/BuildProcessors/BuildProcessorUtil.cs","lineNumber":21,"sourceCode":"using UnityEditor.Build;\n\nnamespace HybridCLR.Editor.BuildProcessors\n{\n\n\tpublic static class BuildProcessorUtil\n\t{\n\n        public static string GetXcodeProjectFile(string pathToBuiltProject)\n        {\n            foreach (string dir in Directory.GetDirectories(pathToBuiltProject, \"*.xcodeproj\", SearchOption.TopDirectoryOnly))\n            {\n                string pbxprojFile = $\"{dir}/project.pbxproj\";\n                if (File.Exists(pbxprojFile))\n                {\n                    return pbxprojFile;\n                }\n            }\n            throw new BuildFailedException($\"can't find xxxx.xcodeproj/project.pbxproj in {pathToBuiltProject}\");\n        }\n    }\n}\n\n","sourceCodeStart":3,"sourceCodeEnd":26,"githubUrl":"https://github.com/egametang/ET/blob/5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f/Packages/cn.etetet.hybridclr/Scripts/Editor/Share/BuildProcessors/BuildProcessorUtil.cs#L3-L26","documentation":"Thrown by BuildProcessorUtil.GetXcodeProjectFile when no subdirectory matching *.xcodeproj containing a project.pbxproj file is found inside the given build output path. This function is called during iOS post-build processing to locate the Xcode project that Unity should have generated, so it can be patched with HybridCLR-specific modifications.","triggerScenarios":"GetXcodeProjectFile is called with a pathToBuiltProject that does not contain a *.xcodeproj directory. This happens when the build target is iOS but Unity did not export an Xcode project (e.g. the build path is wrong, the build failed silently, or the export went to a different location), or when the build target is not iOS at all.","commonSituations":"The build output path in Player Settings does not match the actual export location; the iOS build failed or was interrupted before the Xcode project was created; calling post-build processing code for a non-iOS platform; the path contains a typo or stale reference from a previous configuration.","solutions":["Verify the build target is iOS and that the build completed successfully, producing an .xcodeproj in the output folder.","Check that pathToBuiltProject points to the directory Unity actually wrote the Xcode project to.","Manually inspect the build output directory for a .xcodeproj folder — if absent, re-run the build.","Ensure no post-build script moved or deleted the Xcode project before this code runs."],"exampleFix":"// before\nstring pbxproj = BuildProcessorUtil.GetXcodeProjectFile(pathToBuiltProject);\n\n// after — check existence first with a clear error\nstring[] xcodeDirs = Directory.GetDirectories(pathToBuiltProject, \"*.xcodeproj\", SearchOption.TopDirectoryOnly);\nif (xcodeDirs.Length == 0)\n{\n    Debug.LogError($\"No .xcodeproj found in {pathToBuiltProject}. Verify iOS build completed and output path is correct.\");\n    return;\n}\nstring pbxproj = BuildProcessorUtil.GetXcodeProjectFile(pathToBuiltProject);","handlingStrategy":"validation","validationCode":"string[] xcodeProjects = Directory.GetDirectories(pathToBuiltProject, \"*.xcodeproj\", SearchOption.TopDirectoryOnly);\nif (xcodeProjects.Length == 0)\n{\n    Debug.LogError($\"No .xcodeproj found in '{pathToBuiltProject}'. \" +\n        \"Verify the build target is iOS, the build completed, and the output path is correct.\");\n    return;\n}","typeGuard":"static bool HasXcodeProject(string path)\n{\n    return Directory.GetDirectories(path, \"*.xcodeproj\", SearchOption.TopDirectoryOnly).Length > 0;\n}","tryCatchPattern":"try\n{\n    string pbxproj = BuildProcessorUtil.GetXcodeProjectFile(pathToBuiltProject);\n}\ncatch (BuildFailedException ex) when (ex.Message.Contains(\"project.pbxproj\"))\n{\n    Debug.LogError($\"Xcode project not found at '{pathToBuiltProject}'. \" +\n        \"Ensure the iOS build completed and the output path in Player Settings is correct.\");\n}","preventionTips":["Verify the build target is iOS and the build completed before post-build processing runs.","Check Player Settings > Build Output Path matches the directory passed to GetXcodeProjectFile.","Ensure no earlier post-build script moves or deletes the Xcode project.","Log the contents of pathToBuiltProject on failure to diagnose missing or renamed directories."],"tags":["hybridclr","ios-build","xcode","post-build","build-processor","file-not-found"],"backgroundTag":null,"analyzedSha":"5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f","analyzedAt":"2026-08-13T21:10:40.377Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}