atteneder / glTFast

Efficient glTF 3D import / export package for Unity
Other
1.24k stars 251 forks source link

Error implementing glTFast library v.5.0 #584

Open NakedKiwi opened 1 year ago

NakedKiwi commented 1 year ago

While implementing Ready Player Me on our project on Unity 2022.1.24f1 we need to implement also glTFast, and doing so give us this compiling error:

Library\PackageCache\com.atteneder.gltfast@76f76584a1\Runtime\Scripts\GltfImport.cs(397,13): error CS0518: Predefined type 'System.IAsyncDisposable' is not defined or imported

Take note that we are upgrading to the newer version of RPM, we have talked to them in their Discord but they told us to open an issue here.

The steps to reproduce the bug is hard to tell, if we implement RPM from zero it works, but it doesn't in our project. We have updated RPM from version 1.13.1 to 1.13.2 where they now use this library. Also we tehorize that maybe one of our plugins is having conflicts with your library such as Mirror.

Screenshots If applicable, add screenshots to help explain your problem.

I attach an image of the error.

image

Thank you!

DmitryUlyanov commented 1 year ago

See this: https://github.com/atteneder/glTFast/issues/550#issuecomment-1400257136

By the way, try Avaturn

NakedKiwi commented 1 year ago

Yes I read that post but it didn't solve my problem though.

DWRDV commented 1 year ago

It looks like this line is attempting to follow what is outlined here using await stack overflow, however it seems unnecessary as the await occurs on reading the files bytes after. I'd recommend that the maintainers remove this portion or rework it to perform the cleanup in some other way.

camnewnham commented 1 year ago

This still occurs for me on the latest main commit https://github.com/atteneder/glTFast/commit/5c36f4405012b13ad14ec871b77ba063c53cbbc3 with Unity 2021.3.23f1 (Windows Editor)

image image

AhmadMansy commented 1 year ago

I also have this issue when building for android and webgl on gitlab ci, iOS and windows are working fine

Holo-Krzysztof commented 1 year ago

We also ran into this; the issue was due to our project having a copy of Microsoft.Bcl.AsyncInterfaces.dll as a dependency of an old AWS SDK. This was necessary in Unity 2020, but 2021 doesn't need it anymore it seems. It only triggered on UWP builds, but I guess that is because it's ifdef'd out in glTFast and there was no other usage of IAsyncDisposable in our project.

I'm surprised any of our code worked at all. ._.

ntreadway commented 1 year ago

I'm also experiencing this issue. Is there work around?

I'm tried with 5.2 as well.

C:\Users\Shadow\Downloads\glTFast-com.atteneder.gltfast-5.2.0.tar\glTFast-com.atteneder.gltfast-5.2.0\glTFast-com.atteneder.gltfast-5.2.0\Runtime\Scripts\GltfImport.cs(385,13): error CS0518: Predefined type 'System.IAsyncDisposable' is not defined or imported

willneedit commented 6 months ago

Same case, but I need the Microsoft.Bcl.AsyncInterfaces.dll because of an another plugin's dependencies, but I had to add a workaround mentioned in https://github.com/dotnet/roslyn/issues/45111 :

#if UNITY_2021_3_OR_NEWER && NET_STANDARD_2_1

namespace System
{
    public enum IAsyncDisposable
    {
    }
}

#endif

Even more curious, my VS thinks that the affected code is conditioned out.