Skip to content
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

Particle.Maui not working on .NET 7.0 .NET Android (works fine on Windows) #1

Open
Bebz0r opened this issue Apr 25, 2023 · 2 comments

Comments

@Bebz0r
Copy link

Bebz0r commented Apr 25, 2023

Hello there,

I'm having trouble using Particle.Maui on Android : it works flawlessly on Windows but nothing is shown on Android.

Here is what I did :
Created a new MAUI .NET 7.0 App
Added the NuGet Particle.MAUI 1.0.3
Added the .UseSkiaSharp() in the MauiProgram.cs
Added the namespace to the mainpage.xaml : xmlns:particle="clr-namespace:Particle.Maui;assembly=Particle.Maui"
Added the particle viewport
Launched on Windows : works
Launched on Android : do not work : the app is launched but no particles appear - no error messages

The code is fairly simple : MauiProgram.cs
using Microsoft.Extensions.Logging;
using SkiaSharp.Views.Maui.Controls.Hosting;

namespace TestParticles;

public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp()
.UseSkiaSharp()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});

#if DEBUG
builder.Logging.AddDebug();
#endif

	return builder.Build();
}

}

And the MainPage.xaml :

<Grid VerticalOptions="FillAndExpand"
      BackgroundColor="White"
      Margin="0 ,0, 0, 5">


<particle:ParticleView x:Name="MyParticleCanvas"
                        IsActive="True"
                        IsRunning="True"
                        HasFallingParticles="True"
                        FallingParticlesPerSecond="20"
                        Margin="0, 20"
                        VerticalOptions="FillAndExpand"
                        HorizontalOptions="FillAndExpand"/>
</Grid>

The MainPage.cs is nearly empty :
namespace TestParticles;

public partial class MainPage : ContentPage
{
// Started a new .NET MAUI Projet (.NET 7 - same result with .NET 6)
// Added the NuGet Particle.MAUI 1.0.3
// Added the .UseSkiaSharp() in the MauiProgram.cs
// Added the namespace to the mainpage.xaml : xmlns:particle="clr-namespace:Particle.Maui;assembly=Particle.Maui"
// Added the particle viewport
/*
<particle:ParticleView x:Name="MyParticleCanvas"
FallingParticlesPerSecond="25.0"
IsActive="True"
IsRunning="True"
HasFallingParticles="True"
Margin="0, 20"
VerticalOptions="FillAndExpand"
HorizontalOptions="FillAndExpand"
InputTransparent="True"/>
*/
public MainPage()
{
InitializeComponent();
}

I created a GitHub example : https://github.com/Bebz0r/TestParticles

I tried with version 1.0.2 and 1.0.3 to no avail.

Any ideas ?

Cheers,
Beb

@Bebz0r
Copy link
Author

Bebz0r commented Apr 25, 2023

Wait up, it may be something linked to my device : animations suddently stopped to work on my device, and this for all MAUI .NET applications, even the ones previously installed. No idea why.

@Bebz0r
Copy link
Author

Bebz0r commented Apr 25, 2023

That was my fault, my device was in battery saver mode, and animations don't play if that's the case. So this is not an issue. Sorry about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant