gree / unity-webview

zlib License
2.23k stars 684 forks source link

“WebView.bundle” is damaged #930

Open jeeteshb opened 1 year ago

jeeteshb commented 1 year ago

I am getting the below error when importing the plugin for WebGL project

“WebView.bundle” is damaged and can’t be opened. You should move it to the Bin.

I am using Unity 2020.3.18f1 with Mac OS Ventura 13.4.

KojiNakamaru commented 1 year ago

If you download and import unity-webview.unitypackage or clone this repository with git, the issue won't happen. If you download and extract unity-webview.zip, the issue will happen as downloaded files are marked with the com.apple.quarantine attribute. For the latter case, you can remove the attribute as below:

xattr -d -r com.apple.quarantine unity-webview.zip
jeeteshb commented 1 year ago

Thank you @KojiNakamaru for your prompt reply. With your solution I can able to pass the "WebView.bundle is damaged" error.

But Now I am getting a new error at when trying to build WebGL build

System.ComponentModel.Win32Exception (2): No such file or directory at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec) at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at Unity.IL2CPP.Shell.SetupAndStart(ExecuteContext context, Boolean asyncMode) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Shell/Shell.cs:line 423 at Unity.IL2CPP.Shell.ExecuteAsync(ExecuteArgs executeArgs, IExecuteController controller, Boolean asyncMode) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Shell/Shell.cs:line 299 at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Shell/Shell.cs:line 355 at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Building/CppProgramBuilder.cs:line 334 at Unity.IL2CPP.Building.ParallelFor.<>c__DisplayClass1_0`2.b__0(Object o) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Building/ParallelFor.cs:line 78

UnityEditor.BuildPlayerWindow+BuildMethodException: 13 errors

KojiNakamaru commented 1 year ago

As discussed in https://forum.unity.com/threads/case-1412113-builderror-osx-12-3-and-unity-2020-3-constant-build-errors.1255419/ , you need to install python2. If you already have brew, you can install python2 as below,

brew install pyenv
pyenv install 2.7.18
pyenv global 2.7.18

and invoke Unity Hub as below to make it recognize python2:

env EMSDK_PYTHON=~/.pyenv/shims/python2 open -a "Unity Hub"

Please also note there are extra steps required for WebGL: https://github.com/gree/unity-webview/tree/d2d8dd748a0dbe834ed70e60a99fa2fce1c307ab#webgl

jeeteshb commented 1 year ago

Hi @KojiNakamaru thanks for the detail explanation. I already had python2 2.7.18 but when I followed your steps I was still getting the same errors again n again. Then I came across this code below by dimitroff to create PreBuildProcessing file and it resolved the Build time Win32Exception error. I suppose because of some reason Unity is not recognising the python

https://forum.unity.com/threads/case-1412113-builderror-osx-12-3-and-unity-2020-3-constant-build-errors.1255419/

Screenshot 2023-06-06 at 8 19 19 PM
KojiNakamaru commented 1 year ago

Thanks for another solution!