AvaloniaUI / avalonia-dotnet-templates

Avalonia Templates for `dotnet new`
MIT License
514 stars 89 forks source link

Xplat templates requires .net 7.0 , although android packages do not support 7.0 yet #236

Closed runkelstein closed 1 year ago

runkelstein commented 1 year ago

Describe the bug

Xplat templates requires .net 7.0 , although android packages do not support 7.0 yet

To Reproduce

  1. Create a project via the cli: dotnet new avalonia.xplat -o MyMobileApp
  2. Open the project inside of rider Installing android workload fails. Because the packages "Avalonia.Android/11.0.2" and "Xamarin.AndroidX.Core.SplasScreen/1.0.1.1" do not support .net7.0

using the command dotnet new avalonia.xplat -o MyMobileApp -f net6.0 fails, because only net7.0 was added as a choice to the template

Avalonia Templates version

11.0.0

Avalonia version

No response

Additional context

No response

runkelstein commented 1 year ago

I tried to change the framework to 6.0 manually. However the browers project needs 7.0 to compile, so I left this one unchanged..

I removed IOS cause I cant work with it on my linux desktop anyway I guess.

I still cant compile the solution with the android project, even after downgrading to 6.0. It tells me to install the android workload. But when I run "workload restore" or "workload install android", it tells me it is allready installed.

The reason why I thought 7.0 would not work is, because when I checked the android packages in the nuget library, it told me that only net6.0 is supported.


So how do I get it to work? How can I install an android workload for net6? I added a global json and changed the framework to 6.0. But then it cant find a android workload at all

runkelstein commented 1 year ago

Ok I got it to work with dotnet6 now. I had to switch from ubuntu to microsoft packages. Application now runs inside the android emulator.

However I still think that probably the template cannot support 7.0 for android or can it ? For now im running with 6.0 for this project

maxkatz6 commented 1 year ago

It's definitely a wrong issue, as Avalonia.Android supports .NET 7 with no problems. With 11.1 release, it won't support .NET 6 at all instead.

maxkatz6 commented 1 year ago

Installing android workload fails.

If you have issues installing workloads, please double check that you have up to date .NET SDK installed. And if you still have issues, then it's probably something to do with dotnet/sdk or xamarin/xamarin-android.