Importing Google play services plugin: `Could not find a part of the path` exception

风格不统一 提交于 2021-01-28 08:10:06

问题


When I import the google play services plugin for unity it gives me an error:

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

This is the complete stack trace:

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:


I was having the same error. I fixed it by reimporting with these steps:

  1. Delete Assets/PlayServicesResolver and Assets/GooglePlayGames folders.
  2. Restart Unity.
  3. Import again the last version of the plugin: https://github.com/playgameservices/play-games-plugin-for-unity/blob/master/current-build
  4. Window -> Google Play Games -> Setup -> Android Setup... (perform your personal setup here as described)

I tried this same approach without restarting Unity in point 2) and didn't work, so be sure you do this point. I hope this will help you.



来源:https://stackoverflow.com/questions/48019511/importing-google-play-services-plugin-could-not-find-a-part-of-the-path-excep

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