Xcode upgrade: PBXContainerItemProxy missing containerPortal key

the project icon which we see i.e project-name.xcodeproj, is actually a directory, you do this

1. in terminal do cd your project.xcodeproj
2.ls
3.vi project.pbxproj
4. scroll down till /* Begin PBXContainerItemProxy section */
5.there you will see all sections check for the section which is missing a portal key edit it and save it :wq it will work

in the image if you see the first section is missing container portal key.just pic it from other section and replace it.. it will work

A pat on the back !!