问题
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:
- Delete Assets/PlayServicesResolver and Assets/GooglePlayGames folders.
- Restart Unity.
- Import again the last version of the plugin: https://github.com/playgameservices/play-games-plugin-for-unity/blob/master/current-build
- 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