Cysharp / YetAnotherHttpHandler

YetAnotherHttpHandler brings the power of HTTP/2 (and gRPC) to Unity and .NET Standard.
MIT License
353 stars 31 forks source link

Google.Protobuf dependancy #17

Open YasiWonb opened 1 year ago

YasiWonb commented 1 year ago

Hello, I think there is a dependancy on Google.Protobuf nuget package which is not mentioned.

DeepP2667 commented 11 months ago

Also wondering about this, should this be added to the dependencies package?

mayuki commented 11 months ago

Google.Protobuf is not essential but it is indeed the de facto standard. I also thought about building a redistribution package, but if I install that package from UnityNuGet, the following error occurs.

Assembly 'Packages/org.nuget.google.protobuf/Google.Protobuf.dll' will not be loaded due to errors: Google.Protobuf references strong named System.Runtime.CompilerServices.Unsafe Assembly references: 4.0.4.1 Found in project: 6.0.0.0. Assembly Version Validation can be disabled in Player Settings "Assembly Version Validation"

According to the error message, you can use it if you change the Player Settings, but it's difficult to judge whether it's good to distribute something that causes an error.

Cova8bitdots commented 8 months ago

Assembly 'Packages/org.nuget.google.protobuf/Google.Protobuf.dll' will not be loaded due to errors: Google.Protobuf references strong named System.Runtime.CompilerServices.Unsafe Assembly references: 4.0.4.1 Found in project: 6.0.0.0. Assembly Version Validation can be disabled in Player Settings "Assembly Version Validation"

This error is happened from v1.0.0. This version of SDK refers System.Runtime.CompilerServices.Unsafe 6.0.0 https://github.com/Cysharp/YetAnotherHttpHandler/releases/tag/redist-20240111-01

On the other hand, there is no error message with v0.1.0 which refers System.Runtime.CompilerServices.Unsafe 4.5.3. https://github.com/Cysharp/YetAnotherHttpHandler/releases/tag/redist-20230728-01

The latest version of Google.Protobuf refers System.Runtime.CompilerServices.Unsafe 4.5.2 or above , however unity alerts error message if some SDKs refer different major version of System.Runtime.CompilerServices.Unsafe. https://www.nuget.org/packages/Google.Protobuf/#dependencies-body-tab

Is it possible to downgrade version of System.Runtime.CompilerServices.Unsafe which is refered by YetAnotherHttpHandler?

(cf, even if we change Script Backend or Api Compatibility Level in Player Settings, the error is not fixed.)

mayuki commented 8 months ago

In my environment (Unity 2021.3.22f1), the error does not occur with a combination of System.Runtime.CompilerServices.Unsafe 6.0.0 and Google.Protobuf 3.25.2. Could you please tell me your version?

Cova8bitdots commented 8 months ago

@mayuki

Could you please tell me your version?

The error occurs with Unity 2021.3.16f1. However, the error does not occur with latest Unity LTS version (Unity2022.3.18f1 ).

So it seems that there is minimum support version of Unity between 2021.3.16f1 and 2021.3.22f1.

I apologize taking your time.

AntonPetrov83 commented 2 months ago

As I understand Google.Protobuf is required by gRPC client library, at least it was like this for me. For Unity 2022.3.41 everything compiled after I copied Google.Protobuf.dll netstandard2.0 from the official nuget package.