我有一个在 Android 中正常运行的完整游戏,并且已经在 Play 商店上发布。现在我想在 iTunes 上提交它。当我开始为 iOS 构建相同的项目时,我得到了这个奇怪的错误 -
IOException: Sharing violation on path /Users/abhi/Projects/Unity/XCode Proj/Hammer Inc/Unity-iPhone.xcodeproj/project.pbxproj
System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/FileStream.cs:320)
System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share)
(wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
System.IO.File.OpenRead (System.String path) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/File.cs:363)
System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/StreamReader.cs:167)
System.IO.StreamReader..ctor (System.String path)
(wrapper remoting-invoke-with-check) System.IO.StreamReader:.ctor (string)
System.IO.File.OpenText (System.String path) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/File.cs:368)
System.IO.File.ReadAllLines (System.String path) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/File.cs:560)
AdColonyPostProcessBuild.updateXcodeProject (System.String pbxProjectFilePath, System.String thirdPartyFrameworkDirectoryPath, .Framework[] frameworksToAdd) (at Assets/Editor/AdColonyPostProcessBuild.cs:356)
AdColonyPostProcessBuild.OnPostProcessBuild (BuildTarget target, System.String path) (at Assets/Editor/AdColonyPostProcessBuild.cs:340)
UnityEditor.HostView:OnGUI()
我收到了这个错误,因为我在使用 GPG 插件时遇到了一些问题,并且如此处所述,我删除了与 Google Play 游戏相关的文件和文件夹,因为我计划在 iOS 中使用 Game Center。
我目前在同一个项目中使用 Native-X、Adcolony、Revmob(我知道这太多了,但这是由于选择合适网络的实验所致)。我不确定哪个插件导致冲突。
我尝试删除 AdColonyPostProcessBuild.cs 文件,但它给出了以下错误 -
KeyNotFoundException: The given key was not present in the dictionary.
System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (.TKey
key) (at
/Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/
corlib/System.Collections.Generic/Dictionary.cs:150)
UnityEditor.XCodeEditor.PBXResolver.ResolveName (System.String guid) (at
Assets/Editor/iOS/PBX Editor/PBXParser.cs:49)
UnityEditor.XCodeEditor.PBXResolver.ResolveName (System.String guid) (at
Assets/Editor/iOS/PBX Editor/PBXParser.cs:53)
UnityEditor.XCodeEditor.PBXParser.GUIDComment (System.String guid,
System.Text.StringBuilder builder) (at Assets/Editor/iOS/PBX
Editor/PBXParser.cs:218)
UnityEditor.XCodeEditor.PBXParser.SerializeString (System.String
aString, System.Text.StringBuilder builder, Boolean useQuotes, Boolean
readable) (at Assets/Editor/iOS/PBX Editor/PBXParser.cs:546)
UnityEditor.XCodeEditor.PBXParser.SerializeDictionary
(System.Collections.Generic.Dictionary`2 dictionary,
System.Text.StringBuilder builder, Boolean readable, Int32 indent) (at
Assets/Editor/iOS/PBX Editor/PBXParser.cs:481)
UnityEditor.XCodeEditor.PBXParser.SerializeValue (System.Object value,
System.Text.StringBuilder builder, Boolean readable, Int32 indent) (at
Assets/Editor/iOS/PBX Editor/PBXParser.cs:439)
UnityEditor.XCodeEditor.PBXParser.SerializeDictionary
(System.Collections.Generic.Dictionary`2 dictionary,
System.Text.StringBuilder builder, Boolean readable, Int32 indent) (at
Assets/Editor/iOS/PBX Editor/PBXParser.cs:489)
UnityEditor.XCodeEditor.PBXParser.SerializeValue (System.Object value,
System.Text.StringBuilder builder, Boolean readable, Int32 indent) (at
Assets/Editor/iOS/PBX Editor/PBXParser.cs:439)
UnityEditor.XCodeEditor.PBXParser.Encode
(UnityEditor.XCodeEditor.PBXDictionary pbxData, Boolean readable) (at
Assets/Editor/iOS/PBX Editor/PBXParser.cs:177)
UnityEditor.XCodeEditor.XCProject.CreateNewProject
(UnityEditor.XCodeEditor.PBXDictionary result, System.String path) (at
Assets/Editor/iOS/XCProject.cs:620)
UnityEditor.XCodeEditor.XCProject.Save () (at
Assets/Editor/iOS/XCProject.cs:645) XCodePostProcess.OnPostProcessBuild
(BuildTarget target, System.String path) (at
Assets/Editor/iOS/XCodePostProcess.cs:35) UnityEditor.HostView:OnGUI()
以前有没有人遇到过这个问题并找到任何解决方案?我不想从项目中删除每个 SDK 并重新开始构建它。