导入Google Play服务插件:“无法找到路径的一部分”异常

时间:2017-12-29 08:10:59

标签: unity3d google-play-services

当我为单位导入google play服务插件时,它会给我一个错误:

Could not find a part of the path  
"C:\ExternalWork\Island\Assets\GooglePlayGames\Plugins\Android\GooglePlayGamesManifest.plugin\AndroidManifest.xml".

这是完整的堆栈跟踪:

System.IO.DirectoryNotFoundException: Could not find a part of the path "C:\ExternalWork\Island\Assets\GooglePlayGames\Plugins\Android\GooglePlayGamesManifest.plugin\AndroidManifest.xml".
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x001be] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/FileStream.cs:292 
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
  at System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding, Int32 bufferSize) [0x00039] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/StreamWriter.cs:124 
  at System.IO.StreamWriter..ctor (System.String path, Boolean append) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.IO.StreamWriter:.ctor (string,bool)
  at GooglePlayGames.Editor.GPGSUtil.WriteFile (System.String file, System.String body) [0x0000b] in C:\ExternalWork\Island\Assets\GooglePlayGames\Editor\GPGSUtil.cs:192 
  at GooglePlayGames.Editor.GPGSUtil.GenerateAndroidManifest () [0x0007e] in C:\ExternalWork\Island\Assets\GooglePlayGames\Editor\GPGSUtil.cs:479 
  at GooglePlayGames.Editor.GPGSUpgrader..cctor () [0x0018a] in C:\ExternalWork\Island\Assets\GooglePlayGames\Editor\GPGSUpgrader.cs:111 
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes()

1 个答案:

答案 0 :(得分:3)

我遇到了同样的错误。我通过重新导入这些步骤来修复它:

  1. 删除资产/ PlayServicesResolver和Assets / GooglePlayGames 文件夹。
  2. 重启Unity。
  3. 再次导入最后一个版本 插入: https://github.com/playgameservices/play-games-plugin-for-unity/blob/master/current-build
  4. 窗口 - &gt; Google Play游戏 - &gt;设置 - &gt; Android设置...(按照描述在此处执行您的个人设置)
  5. 我在第2点没有重新启动Unity时尝试了同样的方法并且没有用,所以一定要确保你这样做。 我希望这会对你有所帮助。