microcharts-dotnet / Microcharts

Create cross-platform (Xamarin, Windows, ...) simple charts.
MIT License
2.01k stars 361 forks source link

[Bug] Microcharts.Maui 1.0.0 Does not work in .NET MAUI 8 #344

Open tusharsjagdale opened 10 months ago

tusharsjagdale commented 10 months ago

Describe the bug Microcharts.Maui 1.0.0 Does not rebuild in .NET MAUI 8 for Android platform

Which platform and version is this for? Android

To Reproduce Steps to reproduce the behavior:

  1. Add reference of Microcharts.Maui 1.0.0 in MAUI 8 Project
  2. Rebuild for Android Platform
  3. See error

Expected behavior It should rebuild successful for android platform

Screenshots image

Ghostbird commented 9 months ago

I don't think this is an issue with Microcharts. I'll randomly get this error when trying to build a MAUI.NET 8 app on my machine, yet it never happens in a clean CI build. I think this is some weird build caching issue. The library is working with MAUI.NET 8 for me.

Legends commented 9 months ago

.Net Maui on .net 8 Testing on local android 11 -API 30 device. (It works fine on .net-7)

image ^

@tusharsjagdale : There is a wa for ur problem here

Legends commented 9 months ago

Ok, I solved it by adding a reference to SkiaSharp.Views.Maui.Controls 2.88.6 to my application. Ref

prosperkmurau commented 9 months ago

also faced this problem, please help on how i can solve it for .net8. when i install the microcharts.maui nugget package, i immadiately encounter a warning on the transitive skiasharp package (vulnerable), even if i update the skiasharp to the latest stable, its not solving those android resource errors

sulmar commented 9 months ago

@Legends thank you for your hint. I solved too in this way, but it is best to improve the Microcharts.Maui package so that it adds all the necessary libraries on its own.

mdelgadov commented 1 month ago

It works in Maui net8, but the installation is a bit finnicky. Use https://github.com/PickleBurg/ImageSource-Memory-Leak branch chart-stuff as a path to fix it (especially if you do MVVM toolkit)

The biggest issue aside for the Skia dependency is the type declaration :

[ObservableProperty] private LineChart myChart;

Also use the

<charts:ChartView Chart="{Binding MyChart}" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" />

to bind to the VM