“IOException: Sharing violation on path” on building a Unity project on Mac OS X with Facebook Unity SDK 5.1

非 Y 不嫁゛ 提交于 2019-12-12 18:35:03

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!