unity发布遇到的三个坑

坑一

ArgumentException: The Assembly System.Configuration is referenced by System.Data (‘Assets/Plugins/System.Data.dll’). But the dll is not allowed to be included or could not be found. 解决方法: 打开PlayerSettings,将.NET 2.0 Subset 改为.NET 2.0 。

坑二

UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0020e] in D:unityEditorMonoBuildPlayerWindowBuildMethods.cs:181 解决方法: 添加了一个无用的Scene,删除之后重新添加自己的Scene即可,或者不选,unity可以自己识别当前的场景。

坑三

Because you are not a member of this project this build will not access Unity services. 这是由于你当前登陆的 Unity 账户不在项目的成员列表中。

如果这个项目从头到尾都是你在做,而且之前打包是没问题的,那么很可能是你创建项目时的 Unity 账户跟当前登陆的 Unity账户不同(创建项目时未登录现在登陆了,或者创建项目时登陆了现在未登录,或者项目是别人创建的你拿过来用等等)。 解决方法: 打开服务选项卡(点击窗口–>服务,或者直接快捷键 ctrl + 0)。 点 new link --> 选择自己的Unity 账号 --> create 然后将自己的账号加进去就好了。

经验分享 程序员 微信小程序 职场和发展