-
Notifications
You must be signed in to change notification settings - Fork 754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot compile Xamarin Android project with System.Reactive v4.1.0 #803
Comments
@DrQwertySilence: Could you please provide the diagnostic MSBuild log output or a The most likely cause is that Which version of Xamarin.Android are you using? |
|
@DrQwertySilence: The
followed by a long list of places MSBuild looked for |
@jonpryor I tried with 15.8 stable:
Our error message is a lot better now, this is from the error pad. What is weird about this, is the System.Reactive NuGet has a dependency on System.Threading.Tasks.Extensions, why isn't it installed? When I look at the build log, the NuGet MSBuild task, has outputs:
@DrQwertySilence when I manually install |
|
Ok related issue: dotnet/android#1879 Exact same |
Ok, there is a new facade assembly for I think the plan is to get a newer mono in the next VS release. I need to see if the workaround of using |
Given that VS just shipped 15.8, waiting for the next release will cause a world of pain. We really need this in a 15.8.x bugfix release ASAP. Users are hitting issues due to these missing assemblies already, particularly due to |
This terrible code isn't crashing for me at runtime (using 4.4.0 public async Task<int> SlowAdd (int x, int y)
{
var observableX = SlowInt (x).ToObservable ();
var observableY = SlowInt (y).ToObservable ();
return await observableX.Zip (observableY, (_x, _y) => _x + _y);
}
public async Task<int> SlowInt (int x)
{
await Task.Delay (1);
return x;
} This should be calling into In the meantime, I'll see if I can find the right people to ask about this. |
@jonathanpeppers Sorry, I do not have access to a computer atm. |
Filed on the mono side: mono/mono#10142 |
@jonathanpeppers What I have tried:
|
@DrQwertySilence I was using <PackageReference Include="System.Reactive" Version="4.1.0" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.4.0" /> I used the NuGet dialogs in VS Windows. Hopefully, we'll get something from the mono team. |
@DrQwertySilence at the very least, migrate away from |
@jonathanpeppers @onovotny Yup, that did the trick. Thank you very much people. |
Not only is there not a context menu for packages.config, packages.config doesn't even show up in the solution, so it can't possibly have a context menu. At least on 7.6 Preview (7.6 build 2086). |
That context menu is in Visual Studio for Windows. The Mac version does not have that migration utility currently. |
Not sure if it's related to this but I'm having a lot of issues with Rx 4.1.0 and then downgrading Tasks.Extensions to 4.4.0 so that Android compiles.. Zip seems to be totally broken in some cases. Enumerable.Range(0, 100)
.Select(_ => Observable.Return(Unit.Default))
.Zip()
.Subscribe(_ =>
{
}
); causes the following exception on Android
|
Can you reproduce this in the emulator? |
Yes The attached project is just the basic Xamarin.Android template with System.Reactive installed and running a basic Zip operation If I install just System.Reactive 4.1.0
If I install 4.5.1 of Tasks.Extensions then I get the same error If I downgrade, as was suggested above, to 4.4.0 then I'm able to compile and run in simulator but it crashes (this is the state of the attached sample) If I just downgrade System.Reactive to 4.0.0 then it all runs fine and my Zip command succeeds |
I could reproduce the NullReferenceException in a non-xamarin project. I'll post a fix shortly. |
Since Rx.NET 4.1.0 appears to contain so many fixes and improvements, we eagerly tried to upgrade our packages today (for 1 of our Xamarin apps), but could not compile after doing so (VS Mac 7.6.1 build 9):
Of course, Thanks for looking into this! |
Downgrading System.Threading.Tasks.Extension from 4.5.1 to 4.4.0 worked for me.
|
What worked for me was keeping System.Threading.Tasks.Extensions upgraded, installing System.Runtime.CompilerServices.Unsafe to all android, ios, and uwp projects, and downgrading System.Reactive to version 4.0.0 |
If you want the most repeatable thing, just add the dlls to your repo and put in a path to the local copy: james@DESKTOP-5ICP5OV:/mnt/c/Users/james/source/repos/App3$ tree binaries/ binaries/ └── netstandard2.0 Also, $(UserProfile) is a weird nonstandard windows hack, so you'll need to add your weird nonstandard Macos hack too -
|
Any other solution than referencing the old 4.4.0 version ? Since 6 months ? Noone uses Reactive in Xamarin ? |
I was using System.Reactive for handling "debounce" behavior... I ended up just using custom C# code to do it so that I could remove the System.Reactive nuget package from my project, as the 4.4.0 solution didn't resolve the issue for me. |
According to https://docs.microsoft.com/de-de/xamarin/android/release-notes/9/9.2, it is fixed in Xamarin.Android 9.1.103.7 which comes with Visual Studio 2019 Preview 2. |
@danielcweber 😢 Unfortunately VS4M Preview 2 comes with Xamarin.Android Version: 9.1.5.1 and thus is still broken. So no Reactive/ReativeUI for this new project, I cannot wait for another preview release and the client will not accept working with anything not on the "stable" channel... |
@sushihangover simply use the workaround, reference the 4.4 version in the Android project. |
Yes, using System.Reactive 4.1.2 and by adding the reference to System.Threading.Tasks.Extensions 4.4.0 it works. Thanks. I hope this year XD will be a fix for this issue |
Where exactly do you add this? Do I add it to the line visual studio is telling me the error occurs? For reference, this is my error. It is in Xamarin.Android.Common.Targets. /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2,2): Error XA2002: Can not resolve reference: |
I tried the steps that you guys commented above, it builds Ok, but when I run the project and access a Page that uses the Reactive, the app Crashes using VS 2019. |
What’s your env? I compiled a project with this exact workaround in VS 2019
and managed to run it
On Wed, 3 Apr 2019 at 16:08 Thiago Maturana ***@***.***> wrote:
I tried the steps that you guys commented above, it builds Ok, but when I
run the project and access a Page that uses the Reactive, the app Crashes
using VS 2019.
If I use VS 2017, it works.
System.Reactive V4.1.2 in the Cross Project and Android Project
System.Threading.Tasks.Extensions V4.4.0 in Android project
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#803 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHbkIy9s-DOMpliwrBTzuqIlXowafmIkks5vdKfggaJpZM4V8syp>
.
--
Best Regards,
Gena
|
Nevermind guys, it's the AutoSuggestBox Plugin that is breaking with VS 2019. |
All release versions of VS 2019 (including for Mac) should come with a fixed version of Xamarin.Android now, I think this can be considered solved now. |
Have some reports this is still happening with VSfM 2019 (8.0 build 1805) for the RXUI project. See reactiveui/ReactiveUI#1955 |
It's now working for me: reactiveui/ReactiveUI#1955 (comment) |
It's still there Severity Code Description Project File Line Suppression State |
According to dotnet/android@bf2b59c, the fix is included in the following versions of Xamarin.Android: From this, I can't see the fix being included in any version of VS 2017 (15.x). Therefore, please upgrade to VS 2019. I will close this issue for now. If anybody sees the issue still persisting despite using the latest version of Visual Studio 2019 and Xamarin.Android, leave a note and detailed version information. |
I can still see the issue in an Azure DevOps build @danielcweber .
My project uses 4.1.5 version of System.Reactive. Downgrading to version 4.0.0 works. |
@TechWatching What's relevant is the version of Visual Studio used in the build. |
I am using the Hosted Visual Studio 2019 agent but I don't know which precise version of Visual Studio 2019 is installed in this Hosted agent and when this version is updated by Microsoft. |
Same issue with Visual Studio Community 2019 for Mac Version 8.0.6 (build 4). |
My Azure DevOps build that fails is the iOS Build so the agent I use is the Hosted macOS High Sierra agent (and not the Hosted VS 2019 agent as I was saying, sorry my bad). The version of VS on this agent is Visual Studio for Mac: 8.0.5.9 @danielcweber I guess the correction was shipped to Visual Studio 2019 but maybe not to Visual Studio for Mac yet, don't you think ? |
Might be worth chasing up on Azure DevOps about that one having a Hosted Agent with VSfM 9 support. Given it's been released it's a reasonable thing to have it available. |
Can anybody look up the actual Xamarin.Android version that gets installed with VSfM 8.0.5.9? |
That's the version that's on azure devops at the moment at least. |
So given the newest is 9.2.3-0 on the hosted agent, and it's fixed in 9.3.0.19. https://github.com/microsoft/azure-pipelines-image-generation/pull/895 According to that they pushed out 9.2.3-0 18 days ago, it takes about 3 weeks for the images to hit the servers according to https://github.com/microsoft/azure-pipelines-image-generation/pull/770#issuecomment-492656299 |
Description
The new dependency System.Threading.Tasks.Extensions cannot be fully resolved on Xamarin Android projects. This is not a problem of Rx.NET but I'm leaving this here so other people can see it.
How to reproduce:
Expected result
An application running
Actual result
An exception is thrown:
Severity Code Description Project File Line Suppression State Error Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. Perhaps it doesn't exist in the Mono for Android profile? File name: 'System.Threading.Tasks.Extensions.dll' at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters) at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(DirectoryAssemblyResolver resolver, ICollection1 assemblies, AssemblyDefinition assembly, Boolean topLevel) at Xamarin.Android.Tasks.ResolveAssemblies.Execute(DirectoryAssemblyResolver resolver) Poi.RxStte
The text was updated successfully, but these errors were encountered: