reactiveui / Pharmacist

Builds observables from events.
MIT License
239 stars 15 forks source link

[BUG] Can't get pharmacist to work in an Uno UWP app #97

Closed weitzhandler closed 3 years ago

weitzhandler commented 4 years ago

I'm trying to get Pharmacist to work on an Uno Platform app. The app consists of 4 platform-specific projects: UWP, Xamarin.Droid, Xamarin.iOS and WASM (.NET Standard).

Here's a repro app that contains a newly generated Uno app (using the Uno Templates Extension), whose project files have been modified to add the following two lines before any other PackageReference declarations, as of this commit:

<PackageReference Include="Pharmacist.MsBuild" Version="1.*" PrivateAssets="all" />
<PackageReference Include="Pharmacist.Common" Version="1.*" />

When trying to build the project, I'm getting errors such as:

error MSB4044: The "PharmacistNuGetTask" task was not given a value for the required parameter "TargetFramework".

image

open-collective-bot[bot] commented 4 years ago

Hey @weitzhandler :wave:,

Thank you for opening an issue. We will get back to you as soon as we can. Also, check out our Open Collective and consider contributing financially.

https://opencollective.com/reactiveui

PS.: We offer priority support for all financial contributors. Don't forget to add priority label once you start contributing :smile:

ReactiveUI - Open Collective
An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms!
glennawatson commented 4 years ago

Thanks, I'll have a look at it today.

glennawatson commented 4 years ago

I'm getting some build errors with the project at the moment. Eg for the droid project I am getting:

/Users/glennwatson/Downloads/UnoPharmacist-master/UnoPharmacist/UnoPharmacist.Shared/Assets/LockScreenLogo.scale-200.png : warning XA0101: @(Content) build action is not supported
/Users/glennwatson/Downloads/UnoPharmacist-master/UnoPharmacist/UnoPharmacist.Shared/Assets/SplashScreen.scale-200.png : warning XA0101: @(Content) build action is not supported
/Users/glennwatson/Downloads/UnoPharmacist-master/UnoPharmacist/UnoPharmacist.Shared/Assets/Square150x150Logo.scale-200.png : warning XA0101: @(Content) build action is not supported
/Users/glennwatson/Downloads/UnoPharmacist-master/UnoPharmacist/UnoPharmacist.Shared/Assets/Square44x44Logo.scale-200.png : warning XA0101: @(Content) build action is not supported
/Users/glennwatson/Downloads/UnoPharmacist-master/UnoPharmacist/UnoPharmacist.Shared/Assets/Square44x44Logo.targetsize-24_altform-unplated.png : warning XA0101: @(Content) build action is not supported
/Users/glennwatson/Downloads/UnoPharmacist-master/UnoPharmacist/UnoPharmacist.Shared/Assets/StoreLogo.png : warning XA0101: @(Content) build action is not supported
/Users/glennwatson/Downloads/UnoPharmacist-master/UnoPharmacist/UnoPharmacist.Shared/Assets/Wide310x150Logo.scale-200.png : warning XA0101: @(Content) build action is not supported
/Users/glennwatson/Downloads/UnoPharmacist-master/UnoPharmacist/UnoPharmacist.Droid/Properties/AndroidManifest.xml : warning XA4211: AndroidManifest.xml //uses-sdk/@android:targetSdkVersion '26' is less than $(TargetFrameworkVersion) ''. Using API-28 for ACW compilation.
Resources/values/Styles.xml(2): error APT0000: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
Resources/values/Styles.xml(2): error APT0000: No resource found that matches the given name: attr 'windowActionBar'.
Resources/values/Styles.xml(2): error APT0000: No resource found that matches the given name: attr 'windowNoTitle'.

The UWP project seems to be working now though with 1.4.1.

glennawatson commented 4 years ago

Closing the issue since the Droid issues seem unrelated to Pharmacist. Feel free to comment if that is not the case.

weitzhandler commented 4 years ago

OK, will check about the Droid project, but I actually tried the UWP one. Try unloading all other projects but the UWP one, it doesn't work either.

glennawatson commented 4 years ago

UWP is 100% compiling/working for me.

glennawatson commented 4 years ago

Try doing a NuGet cache clean.

glennawatson commented 4 years ago

with some of these nuget packages it can take a while to update unless you do a nuget cache clean you can clean it with dotnet so like

dotnet nuget locals all --clear
weitzhandler commented 4 years ago

Can Pharmacist work on Xamarin.Droid and Xamarin.iOS?

glennawatson commented 4 years ago

Yep.

glennawatson commented 4 years ago

You gotta consider the scenario with Xamarin is slightly different, almost everyone has a .net standard 2.0 project for the UI, then just a front end for each platform. So you would put pharmacist in your .net standard 2.0 shared project. Uno seems to like shared projects which are slowly disappearing from Microsoft recommended list.

weitzhandler commented 4 years ago

Well I can't change the way Uno works. In a way, this is the advantage of Uno over XF, because it makes a regular UWP app run everywhere.

weitzhandler commented 4 years ago

But if Pharmacist works on Droid and iOS, it should work. Uno creates to regular Xamarin projects, and just adds another assembly Uno.UI which encapsulates the UWP control API for the current platform, same as for WASM.

glennawatson commented 4 years ago

Have you tried the instructions above? It has been working with your trial project for me since yesterday.

weitzhandler commented 4 years ago

I've tried it only with the UWP so far, it did generate the files, but the generated files issued errors. It tries to generate DataContextChanged event, whereas Windows.UI.Xaml.DependencyObject doesn't have such event.

image

weitzhandler commented 4 years ago

Well look like it's the interactivity library. Please see my branch targeting that.

glennawatson commented 4 years ago

The issue is solved in 1.5.3 so do the nuget clear trick and try that.

weitzhandler commented 4 years ago

Thank you. Yes looks like it's working now.

glennawatson commented 4 years ago

Re-opening, doesn't seem like the droid project is producing properly.

glennawatson commented 3 years ago

See https://www.nuget.org/packages/ReactiveMarbles.ObservableEvents.SourceGenerator/ and https://github.com/reactivemarbles/ObservableEventsSourceGenerator

I deliberately included Uno in the testing.

ReactiveMarbles.ObservableEvents.SourceGenerator 1.0.2
Allows to get an observables for property changed events.
GitHub
reactivemarbles/ObservableEventsSourceGenerator
Contribute to reactivemarbles/ObservableEventsSourceGenerator development by creating an account on GitHub.
github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.