Unity WebGL报错BuildPlayerWindow+BuildMethodException

我使用Unity2018.3导出WebGL游戏时发生错误:

UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
  at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x00234] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:190 
  at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:96 
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

我试了一下别人提供的解决方法:

1.项目路径中一定不要有中文

2.发布目录最好和项目在同一级目录下

照做,然而还是报错。

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.

在项目中我用了一个Dll,System.Data.dll文件,很明显报错跟这个有关

我看了一下Dll文件在Inspector中没有WebGL的Platform settings

Unity WebGL报错BuildPlayerWindow+BuildMethodException_第1张图片

现在要么删除Data.dll 并将引用这个库的代码修改,但是这想想就太可怕了。

所以我要看清楚这句话

Dll is not allowed to be included or could not be found

网上有个网友解答了这个问题

Unity WebGL报错BuildPlayerWindow+BuildMethodException_第2张图片

其实设置了Api Compatibility Level为.Net 2.0就行了!

最后学习一下WebGL的开发注意事项

https://blog.uwa4d.com/archives/TechSharing_122.html

你可能感兴趣的:(unity3d)