Open ozersenol opened 1 year ago
@jonathanpeppers - ideas on this? It feels like an AOT type of thing to me, but the report says it fails even without AOT.
System.InvalidProgramException: Invalid IL code in ProxiWash.KasaApp.App:InitializeComponent (): IL_0002: stloc.0
This sounds like it could be a XamlC issue, because it uses Mono.Cecil to write IL inside the InitializeComponent()
method.
@ozersenol does the problem go away if you skip XamlC on this type, ProxiWash.KasaApp.App
:
[XamlCompilation(XamlCompilationOptions.Skip)]
public class App
{
//...
}
If it does, maybe you can share the offending .xaml
file or a code snippet to reproduce this? Thanks.
Hi @ozersenol. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
System.InvalidProgramException: Invalid IL code in ProxiWash.KasaApp.App:InitializeComponent (): IL_0002: stloc.0
This sounds like it could be a XamlC issue, because it uses Mono.Cecil to write IL inside the
InitializeComponent()
method.@ozersenol does the problem go away if you skip XamlC on this type,
ProxiWash.KasaApp.App
:[XamlCompilation(XamlCompilationOptions.Skip)] public class App { //... }
If it does, maybe you can share the offending
.xaml
file or a code snippet to reproduce this? Thanks.
Thank you @jonathanpeppers It worked with [XamlCompilation(XamlCompilationOptions.Skip)] and saved my day !
and code is very ordinary and I did not add anything more since all design comes from blazor part.
[XamlCompilation(XamlCompilationOptions.Skip)]
public partial class App : Application
{
public App()
{
InitializeComponent();
MainPage = new MainPage();
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:ProxiWash.KasaApp"
xmlns:drawing="clr-namespace:System.Drawing;assembly=System.Drawing.Primitives"
x:Class="ProxiWash.KasaApp.App">
<Application.Resources>
<ResourceDictionary>
<drawing:Color x:Key="PageBackgroundColor">#512bdf</drawing:Color>
<drawing:Color x:Key="PrimaryTextColor">White</drawing:Color>
<Style TargetType="Label">
<Setter Property="TextColor" Value="{DynamicResource PrimaryTextColor}" />
<Setter Property="FontFamily" Value="OpenSansRegular" />
</Style>
<Style TargetType="Button">
<Setter Property="TextColor" Value="{DynamicResource PrimaryTextColor}" />
<Setter Property="FontFamily" Value="OpenSansRegular" />
<Setter Property="BackgroundColor" Value="#2b0b98" />
<Setter Property="Padding" Value="14,10" />
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>
@ozersenol this part seems suspicious:
xmlns:drawing="clr-namespace:System.Drawing;assembly=System.Drawing.Primitives"
Can you just use <Color/>
? This would use Microsoft.Maui.Graphics.Color
, I believe.
Absolutely you are right. I changed to
Ok great, so I think we can leave this open, as you should get a build error instead of a runtime error for this, if possible.
But we can move to the backlog for now, thanks!
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.
Description
Hello, My app crushes after splash screen on release mode. It works perfectly on debug mode.
Error given on device log is:
08-31 12:38:37.985 EVEREST-EVERPAD DC-1032 Error 29367 AndroidRuntime android.runtime.JavaProxyThrowable: System.InvalidProgramException: Invalid IL code in ProxiWash.KasaApp.App:InitializeComponent (): IL_0002: stloc.0
and
is this a bug or something missing from my side? If any can help me I really appriciate.
I tried all possible combinations on release with settings: AOT/non-AOT, Linked or Non-linked etc.
Steps to Reproduce
No response
Link to public reproduction project repository
No response
Version with bug
7.0.92
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 10
Did you find any workaround?
No response
Relevant log output
No response