atteneder / KtxUnity

Load KTX and Basis Universal textures at runtime
Apache License 2.0
223 stars 42 forks source link

WebGL - Error when building with Unity 2021.2 Beta #43

Closed MarkTotem closed 3 years ago

MarkTotem commented 3 years ago

Hi there, I recently upgraded a project to Unity 2021.2.0b1 and found that it errors out whenever I try to do a WebGL build.

Building Library\Bee\artifacts\WebGL\build\debug_WebGL_wasm\build.js failed with output: emcc:WARNING: --llvm-lto ignored when using llvm backend emcc2: warning: EXTRA_EXPORTED_RUNTIME_METHODS is deprecated, please use EXPORTED_RUNTIME_METHODS instead [-Wdeprecated] emcc2: error: Packages/com.atteneder.ktx/Runtime/Plugins/WebGL/libktx_read.bc: No such file or directory ("Packages/com.atteneder.ktx/Runtime/Plugins/WebGL/libktx_read.bc" was expected to be an input file, based on the commandline arguments provided) UnityEditor.GenericMenu:CatchMenu (object,string[],int)

The error seems to be connected to the package in some way but the package exists and so does the .bc file it is looking for so I am absolutely stumped. I have tried it in an empty project and it works fine when the Ktx package is not included.

Any help greatly appreciated, been using KtxUnity for a little while now and its been great so thanks for all the effort.

atteneder commented 3 years ago

Hi @MarkTotem ,

Thanks for reporting! The new beta includes a much newer version of emscripten, which changed the way of static linking. For that reason I wanted to try it out soon, but you were faster :)

I have to check myself, but I'm afraid the .bc binary is not compatible with the new emscripten anymore. I'll try if I can get a build running.

MarkTotem commented 3 years ago

Hi @MarkTotem ,

Thanks for reporting! The new beta includes a much newer version of emscripten, which changed the way of static linking. For that reason I wanted to try it out soon, but you were faster :)

I have to check myself, but I'm afraid the .bc binary is not compatible with the new emscripten anymore. I'll try if I can get a build running.

I was afraid you might say that, thanks for looking into it, much appreciated.

atteneder commented 3 years ago

Update: I have a running prototype, but unfortunately there's a bug in the current Unity Beta. We're on it!

MarkTotem commented 3 years ago

Update: I have a running prototype, but unfortunately there's a bug in the current Unity Beta. We're on it!

Awesome thanks for the update, great stuff👍

atteneder commented 3 years ago

This was fixed in KtxUnity 2.0.0. Sorry, I forgot to close this right away.