问题
I get an "IOException: Sharing violation on path" after importing the Facebook Unity SDK.
The exception is thrown from FacebookPostprocess.cs:35, when the PostProcess tries to Save the modified Xcode project.
回答1:
It seems the modified version of XCodeEditor, the Facebook SDK uses, doesn't close the StreamReader.
You should change these lines in Assets\Facebook\Editor\iOS\third_party\XCodeEditor-for-Unity\XCProject.cs from:
projectFileInfo = new FileInfo( Path.Combine( this.filePath, "project.pbxproj" ) );
string contents = projectFileInfo.OpenText().ReadToEnd();
to:
projectFileInfo = new FileInfo( Path.Combine( this.filePath, "project.pbxproj" ) );
StreamReader sr = projectFileInfo.OpenText();
string contents = sr.ReadToEnd();
sr.Close();
The modification is from the original XCodeEditor (https://github.com/dcariola/XCodeEditor-for-Unity).
来源:https://stackoverflow.com/questions/23836364/ioexception-sharing-violation-on-path-on-building-a-unity-project-on-mac-os-x