[SOLVED] Key Not Found Exception - XCODE


I am having a rather frustrating problem, and I can’t seem to find an answer to this anywhere, as it may be a case specific to me.

The problem is that whenever I try to append a project, it will throw the following exception at the post processing stage.

KeyNotFoundException: The given key was not present in the dictionary.
System.Collections.Generic.Dictionary`2[System.String,UnityEditor.iOS.Xcode.PBX.PBXGroup].get_Item (System.String key) 
(at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:150)

UnityEditor.iOS.Xcode.PBXProject.GroupsGetByChild (System.String childGuid)
UnityEditor.iOS.Xcode.PBXProject.RemoveGroupIfEmpty (UnityEditor.iOS.Xcode.PBX.PBXGroup gr)
UnityEditor.iOS.Xcode.PBXProject.RemoveFilesByProjectPathRecursive (System.String projectPath)
UnityEditor.iOS.PostProcessiPhonePlayer.BuildXCodeProject (UnityEditor.iOS.ProjectPaths paths, UnityEditor.iOS.IncludedFileList includedFiles, System.Collections.Generic.List`1 frameworks, System.String sdkVersion, System.String targetOS, System.String productName, Boolean useIl2Cpp, Boolean installInBuildFolder, Boolean useSymlinks, Boolean isGameCenterUsed)

UnityEditor.iOS.PostProcessiPhonePlayer.PostProcess (UnityEditor.iOS.iOSBuildPostprocessor pp, BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String stagingAreaDataManaged, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)

UnityEditor.iOS.iOSBuildPostprocessor.PostProcess (BuildPostProcessArgs args)

UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry) 

(at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:316)

I can replace the project file and it seems to work fine if i do, but this can only be a temporary solution.
I am absolutely sure that the problem does not lie in any of my scripts, as I tried appending a much older backup that had no problems before. Just from a quick glance, it seems xcode may be the problem? It doesn’t seem many others had the same problem as I haven’t found any solutions online.

Can anyone tell me what seems to be the problem here?

If there is any additional information required to solve the problem, please let me know.

Thank you so much!

  • UNIQ

I’ve Found the answer. It seems to have been a unity bug, and has since been fixed as of Unity version 5.1.2. I am currently using 5.1.1f1, and will upgrade to the latest update.

Hope this helps anyone with a similar problem.

Answer Found here: