GithubHelp home page GithubHelp logo

Comments (42)

Nezz avatar Nezz commented on July 19, 2024 49

It's fixed internally on Unity's trunk and is awaiting backport to the 2021.3 branch. I requested an update earlier today on when the backport will be happening.

from unirx.

scho avatar scho commented on July 19, 2024 16

2021.3.0f1 is out - but this issue is still not fixed.
@Nezz: Any news from your source?

from unirx.

scho avatar scho commented on July 19, 2024 14

I've just checked with 2021.3.1f1, it's still not fixed!

from unirx.

Nezz avatar Nezz commented on July 19, 2024 13

The PR for the backport was submitted yesterday for 2021.3. If all goes well, it should be merged and released fairly quickly.

from unirx.

n00levoy avatar n00levoy commented on July 19, 2024 12

Still not fixed in 2021.2.19f1.

from unirx.

kLy avatar kLy commented on July 19, 2024 11

Oooh now the page says:

Fixed in: 2021.3.3f1
Fixed in: ​​​​​​​2022.1.1f1

:)

from unirx.

quabug avatar quabug commented on July 19, 2024 9

A quick workaround of this issue would be put using UniRx into namespace.

namespace Game
{
    using UniRx;
    ...
}

For those code without namespace you have to remove using System as @peterdijkstra suggested.

from unirx.

Nezz avatar Nezz commented on July 19, 2024 9

Some news:

The devs have decided to explicitly exclude System.Reactive.* assemblies from our .NET 4.8 profile. The pull request for this change is now awaiting approval.

In the meantime, it appears you can work around the problem by additionally targeting a runtime platform for the affected assembly definitions (e.g. Editor AND Stadia, if you're not deploying on the Stadia platform, this should have no effect on the project).

from unirx.

Nezz avatar Nezz commented on July 19, 2024 7

I opened a ticket with Unity about this.

from unirx.

ZhouKes avatar ZhouKes commented on July 19, 2024 7

2021.3.2, it's still not fixed!

from unirx.

neuecc avatar neuecc commented on July 19, 2024 6

I've tried on Unity 2021.2.13f1.
API Compatibillity Level: .NET Standard 2.1 is worked.
API Compatibillity Level: .NET Framework, conflicts.

Indeed, it implicitly refers to System.Reactive.*.dll.
I think it's a bug in Unity, so until there's an official announcement (references added, etc.), I'll wait and see.

from unirx.

superkerokero avatar superkerokero commented on July 19, 2024 6

A quick workaround of this issue would be put using UniRx into namespace.

namespace Game
{
    using UniRx;
    ...
}

For those code without namespace you have to remove using System as @peterdijkstra suggested.

This works.
If you happen to be using using System; as well, put it outside of the namespace, then you can use it as normal:

using System;

namespace SomeNamaspace {
    using UniRx;

    ...
}

from unirx.

n00levoy avatar n00levoy commented on July 19, 2024 5

This issue was mentioned in Unity 2022.2a release notes.

from unirx.

scho avatar scho commented on July 19, 2024 5

@kLy: The issue mentions, that it will be fixed in 2021.3:

Fixed in 2022.2.X
Fix In Review for 2021.3.X, 2022.1.X

from unirx.

Nezz avatar Nezz commented on July 19, 2024 4

It's an enterprise support ticket, no point in linking it :)

from unirx.

Nezz avatar Nezz commented on July 19, 2024 4

This is the latest I got:

The devs have informed me that this looks like unintended behaviour but they will need to investigate the problem further.

from unirx.

parkycai avatar parkycai commented on July 19, 2024 4

Still broken in 2021.2.15f1, keep staying in 2021.2.11f1

from unirx.

scho avatar scho commented on July 19, 2024 4

I've just checked out 2021.2.17f1. This issue is still in this version.

from unirx.

scho avatar scho commented on July 19, 2024 4

It's still the same in 2021.2.18f1.

from unirx.

kLy avatar kLy commented on July 19, 2024 2

Woohoo! 2021.3.3 just released! https://unity3d.com/unity/whats-new/2021.3.3

And it includes the fix:

  • Scripting: Removed outdated System.Reactive extensions from .Net 4.8 profile. (1407597)

Tested on my project. Working! :D

from unirx.

peterdijkstra avatar peterdijkstra commented on July 19, 2024 1

I have removed all using System; lines in files where this broke, and just changed IDisposable to System.IDisposable etc. That also works, but might be a hassle if you use UniRx a ton

For what it's worth, this wasn't a problem with 2021.2.8

from unirx.

tangx246 avatar tangx246 commented on July 19, 2024 1

A really preliminary test on 2022.1.1f seems to show that it's fixed. I'm just going to assume that it now works and close this issue

from unirx.

mwnDK1402 avatar mwnDK1402 commented on July 19, 2024

I'm running into this exact issue as well. Tried upgrading to 2021.2, but I don't think that's compatible with UniRx for this reason.

from unirx.

tangx246 avatar tangx246 commented on July 19, 2024

Interestingly, this problem cannot be reproduced in 2021.2.11, but I figured a workaround needs to be found going forward. As far as I can tell, just deleting all the System.Reactive dll's in C:\Program Files\Unity\Hub\Editor\2021.2.12f1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api makes it work with no apparent side effects. Unfortunately, the project now cannot be opened without fiddling with editor files. I've been trying to figure out a way to exclude these DLLs via configuration in the project, but have been unsuccessful.

from unirx.

tangx246 avatar tangx246 commented on July 19, 2024

I opened a ticket with Unity about this.

Are you able to link the ticket here, please?

from unirx.

mwnDK1402 avatar mwnDK1402 commented on July 19, 2024

I have removed all using System; lines in files where this broke, and just changed IDisposable to System.IDisposable etc. That also works, but might be a hassle if you use UniRx a ton

For what it's worth, this wasn't a problem with 2021.2.8

Yeah, that would be +200 files in our project. I'm not confident this issue will really be fixed. Is this repository completely abandoned?

from unirx.

Nezz avatar Nezz commented on July 19, 2024

It's not an issue in UniRx, it's an issue with Unity. Unity 2021.2.12 started referencing System.Reactive.Core for Editor assemblies, most likely as a side-effect of this fix:

Editor: Fixed an issue where there was no automatic filter out and ignore assemblies that were automatic included as a part of the system library references. (1363463)

Because this assembly is not referenced by player assemblies, we can't just put #if UNITY_2021_2_OR_NEWER around the duplicate UniRx implementation. There are two possible solutions:

  1. Reference System.Reactive.Core in both player and editor assemblies and add #if UNITY_2021_2_OR_NEWER to UniRx.
  2. Restore the Unity 2021.2.11 behaviour and not reference System.Reactive.Core in any of the assemblies

Note that if you are targeting the full .NET with your app, System.Reactive.Core might get referenced by player assemblies too and the first approach might work for you already. However, for those like us who target .NET Standard this is not a solution.

from unirx.

Nomad404 avatar Nomad404 commented on July 19, 2024

A workaround for this can be
using UniRxExt = UniRx.ObservableExtensions;

and then use that as a prefix for and UniRx related calls like
UniRxExt.Subscribe(...);

from unirx.

tangx246 avatar tangx246 commented on July 19, 2024

System.Reactive.Core is not automatically available to player assemblies at build time, so we can't just use System.Reactive in our code without pulling it in separately

from unirx.

Chrisdbhr avatar Chrisdbhr commented on July 19, 2024

I also have this issue, just tested and still happening in Unity 2021.2.13f1 (as in 2021.2.12f1).
I will stay on 2021.2.11f1 until some fix in available either on Unity side or this repository side.

from unirx.

PleijaEternal avatar PleijaEternal commented on July 19, 2024

A workaround for this can be
rename SystemsRx.MicroRx.Extensions.IObservableExtensions.Subscribe()

from unirx.

Pixellore avatar Pixellore commented on July 19, 2024

I have similar problem, and I went hard way of renaming the UniRx extension method's names. Which kinda works on Windows platform, but when I try to build for the other platforms such as PS4 or Switch etc, it complains that it is missing the System.Reactive.Core (or not allowed)...

I am using Unity 2021.2.12f1 and full .net targeting.

Any idea? I mean, for windows build, I can see System.Reactive.Core.dll being included in the build...?

ArgumentException: The Assembly System.Reactive.Core is referenced by Assembly-CSharp ('Library/PlayerScriptAssemblies/Assembly-CSharp.dll'). But the dll is not allowed to be included or could not be found.
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List1[T] alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary2[TKey,TValue] cache, UnityEditor.BuildTarget target) (at :0)
UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch, UnityEditor.BuildTarget target) (at :0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

from unirx.

Pixellore avatar Pixellore commented on July 19, 2024

This is the latest I got:

The devs have informed me that this looks like unintended behaviour but they will need to investigate the problem further.

"The devs" => Do you mean from Unity? Any links to the forum thread?

from unirx.

Nezz avatar Nezz commented on July 19, 2024

Yes, from Unity. This is from enterprise support (not public).

from unirx.

scho avatar scho commented on July 19, 2024

And broken in 2021.2.16f1.

from unirx.

fernandodarci avatar fernandodarci commented on July 19, 2024

Really, 2021.3.1f1 it´s still the problem.
But I think that it can solved by UniRx, not Unity.
I solved it in 2 steps:

  1. Change all the Subscribe methods in UniRx.ObservableExtensions to RxSubscribe
  2. Using the Replace Tool in VS, replace in current project all ".Subscribe(" to ".RxSubscribe("
    And done, all conflicting references gone away, program working like a charm.

Just a tip. UniRx uses IObservable, IObserver, Tuple and other C# native System library related names. Put a Rx prefix in names you know that are from those libraries, or other you want. That´s a good practice inherited from C (that don´t have namespaces) to avoid conflicts and big names.

from unirx.

Nezz avatar Nezz commented on July 19, 2024

There is no need for these methods in UniRx if System.Reactive is referenced, since it replicates the same extension methods. The issue is that System.Reactive is referenced only sometimes (Editor assemblies).

from unirx.

kLy avatar kLy commented on July 19, 2024

Hey so it isn't in 2021.3.1? :( Is the backport still happening?

Nezz, there is still no response from Unity? Any link for us to track this backport? Or is this just a PM exchange you're having with Unity?

from unirx.

cpetry avatar cpetry commented on July 19, 2024

Great!
Is 2021.3.3f released yet? Then I'll jump over

from unirx.

Nezz avatar Nezz commented on July 19, 2024

2021.3.3 is not out yet, but hopefully it'll be out soon - it was scheduled for this week.

from unirx.

ZhouKes avatar ZhouKes commented on July 19, 2024

Yesterday I installed 2021.3.3 via UnityHub on one computer, but today I am on another computer and cannot find this version.

from unirx.

momijijin avatar momijijin commented on July 19, 2024

my unity editor version is 2022.1.0b16,when i switch to il2cpp + .net standard2.1(pc platform), this compilation error disappears

from unirx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.