fabulous-dev / Fabulous

Declarative UI framework for cross-platform mobile & desktop apps, using MVU and F# functional programming
https://fabulous.dev
Apache License 2.0
1.15k stars 121 forks source link

Check dependencies for the Android template #542

Closed TimLariviere closed 4 years ago

TimLariviere commented 5 years ago

The Android template seems to be missing some dlls required by Xamarin.Forms. (Support something something LiveData.dll and Java.Interop)

When updating the Xamarin.Forms package, they get added to the project even though XF doesn't update its Android dependencies.

We need to check that.

albertwoo commented 5 years ago

It may also cause the issue when I try to add Fabulous.SimpleElements. https://github.com/Zaid-Ajaj/fabulous-simple-elements/issues/14

albertwoo commented 5 years ago

Can do not use packages.config for manage nuget packages? Because I see the csproj for android created by visual studio 2019 xamarin forms template is not using that and its nuget package is managed directly in the csproj like this (which is very similar with net core project format):

  <ItemGroup>
    <PackageReference Include="Xamarin.Android.Support.v4" Version="25.4.0.2" />
    <PackageReference Include="Xamarin.Forms" Version="3.1.0.637273" />
    <PackageReference Include="Xamarin.Android.Support.Design" Version="25.4.0.2" />
    <PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="25.4.0.2" />
    <PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="25.4.0.2" />
    <PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="25.4.0.2" />
  </ItemGroup>
TimLariviere commented 5 years ago

@albertwoo Unfortunately we can't migrate from packages.config to PackageReference.

See https://github.com/fsprojects/Fabulous/issues/181 for more information.

TLDR: Visual Studio (Windows) doesn't support old format fsproj with PackageReference (and no further feature will be added). We have to wait for Xamarin to move to the new format instead.

albertwoo commented 5 years ago

Oh, that is so sad. So what we can do is just wait :)

Happypig375 commented 5 years ago

Can't you use MSBuild.Sdk.Extras?

TimLariviere commented 5 years ago

@Happypig375 MSBuild.Sdk.Extras is the same issue. You can convert the projects with it and get them to build via MSBuild, but depending on your IDE, you will be unable to debug.

See https://github.com/fsprojects/Fabulous/issues/181#issuecomment-420783259 for more info on MSBuild.Sdk.Extras in Fabulous

PackageReference Visual Studio (Windows) Visual Studio for Mac JetBrains Rider
Old format fsproj ❌ No ✅ Yes ✅ Yes
MSBuild.Sdk.Extras ❌ No ❌ No ✅ Yes

If you happen to use 1 specific IDE that supports your scenario, you can apply PackageReference to your solution. But Fabulous can't use PackageReference by default in the templates, because we don't know which IDE people will use.

TimLariviere commented 4 years ago

The Android template has been migrated to AndroidX in v0.55, so it should be good now.