Unity 之 发布 WebGl 遇到的问题

最近发布的WebGL的时候遇到了些问题,上网查了一下,说法不一,又说和发布目录有关的(这个我试了发布到桌面上也是可以的,建议发布在和项目同级目录下),也有说需要下载Unity 的补丁的(我也试了,并没有发布成功),下面是我发布时遇到的问题截图:

Unity 之 发布 WebGl 遇到的问题_第1张图片

部分报错原文:

Failed running D:\Program Files\Unityweb\Editor\Data\il2cpp/build/il2cpp.exe --convert-to-cpp --compile-cpp --libil2cpp-static --platform=“WebGL” --architecture=“EmscriptenJavaScript” --configuration=“Release” --outputpath=“D:\Unity运行\FirFiappy_Brid\Assets /…/Temp/StagingArea/Data\Native\build.bc” --cachedirectory=“D:\Unity运行\FirFiappy_Brid\Assets…\Library/il2cpp_cache” --compiler-flags="-Oz -DIL2CPP_EXCEPTION_DISABLED=1 " --additional-libraries=“D:\Program Files\Unityweb\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules\WebGLSupport_AIModule_Dynamic.bc” --additional-libraries=“D:\Program Files\Unityweb\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules\WebGLSupport_AnimationModule_Dynamic.bc” --additional-libraries=“D:\Program Files\Unityweb\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules\WebGLSupport_AudioModule_Dynamic.bc” --additional-libraries=“D:\Program Files\Unityweb\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules\WebGLSupport_ClothModule_Dynamic.bc” --additional-libraries=“D:\Program Files\Unityweb\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules\WebGLSupport_CloudWebServicesModule_Dynamic.bc” --additional-libraries=“D:\Program Files\Unityweb\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules\WebGLSupport_CoreModule_Dynamic.bc” --additional-libraries=“D:\Program Files\Unityweb\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules\WebGLSupport_CrashReportingModule_Dynamic.bc” --additional-libraries=“D:\Program Files\Unityweb\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\modules\WebGLSupport_FacebookModule_Dynamic.bc” --additional-libraries="D:\Program

第二个:

Exception: D:\Program Files\Unityweb\Editor\Data\il2cpp/build/il2cpp.exe did not run properly!
UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action1 setupStartInfo) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:98) UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List1 arguments, System.Action1 setupStartInfo, System.String workingDirectory) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:313) UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (ICollection1 userAssemblies, System.String outputDirectory, System.String workingDirectory) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:304)
UnityEditorInternal.IL2CPPBuilder.Run () (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:151)
UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String stagingAreaData, IIl2CppPlatformProvider platformProvider, System.Action`1 modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry, Boolean debugBuild) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:41)
UnityEditor.WebGL.WebGlBuildPostprocessor.CompileBuild (BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:343)
UnityEditor.WebGL.WebGlBuildPostprocessor.PostProcess (BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:871)
UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTargetGroup targetGroup, BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.BuildReporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:186)
UnityEditor.HostView:OnGUI()

在:https://blog.csdn.net/u010930289/article/details/55814101该博主说了发布过程,觉得还是挺完整的;分享给大家,,,

还有一种错误:
Unity 之 发布 WebGl 遇到的问题_第2张图片

解决方法:项目路径中一定不要有中文,检查发布目录最好和项目在同一级目录下,使用多个版本的Unity试着发布,,,也没有多设置什么选项啊之类的,只是按照正常的设置然后发布就成功了(我用的是Win8.1,Unity5.6.1f1,Unity5.6.2,Unity2017.3)。若对以上问题有解决方法的同学,希望可以不吝赐教,感谢之至!

运行的时候会有浏览器兼容的问题,建议大家使用火狐浏览器可以运行,这是个坑啊,,,

你可能感兴趣的:(ジ﹋★☆『,自,卟,說,』,Unity,引擎入门)