English 中文(简体)
Troublefireing Release Building Error in .NET MAUI Application for Anders
原标题:Troubleshooting Release Build Error in .NET MAUI Application for Android

我正在利用7.0306(x64)版和2022年视频演播室17.6.5版,建立一个网络MAUI应用程序。 我认为这些是最新版本。 我现在着重谈谈安康。

The Problem: In debug mode, the application works flawlessly. However, the problem occurs when I try to build the app for release and run it on my real physical test device (Samsung). Just at the end of Visual Studio s compiling process, I get the following error message:

Severity    Code    Description Project File    Line    Suppression State
Warning     MSB3073: The command ""C:Program Files (x86)Androidandroid-sdkplatform-toolsadb" -s RFCN30KRB2M uninstall -k "com.company.appname"" exited with code 1.

视像演播室的一些专门知识可以安装这种器具,但安装在破碎状态。 在安装之前,我从该装置中抽取了该仪器。

What I Have Tried: I have searched for answers online and found an old thread that seems to fit my problem description. However, it s for a Maui Blazor app. MauiIssue

我已经尝试了这一问题作为解决办法的提法,但没有解决问题。

这项工作是。 超支问题:

    <PropertyGroup Condition=" $(TargetFramework)  ==  net7.0-android ">
        <RunAOTCompilation>false</RunAOTCompilation>
        <AndroidLinkMode>None</AndroidLinkMode>
    </PropertyGroup>

然而,我听到说,不应以释放方式放弃这些环境,因为一揽子方案可能变得相当庞大。 我也听到,AOT(实时汇编)对于OS来说确实很重要。

My Question: Does anybody know what s causing this issue, and if it has been fixed? Which .NET version should I be running if it has already been resolved?

Edit: I just created a new MAUI project from scratch to see if an untouched project would build in release mode from the start. I still get the same error. Am I missing something? Is MAUI ready for production?

MauiApp1似乎在发挥作用,但后来又再次如此,这没有什么逻辑。 我试图与联系人建立自己的亲子关系,AOT公司倒台,主要功能——C&C认知服务公司——赢得了适当的工作。 我可以 t笑,要么因为夸大的 t子在释放方式中赢得了 attach。 这究竟是怎样呢?

Edit 2: I just updated to Visual Studio 2022 version 17.7 (came out 8 aug, patch thuesday). I`ll give it a try and see if it fixes the issues I have. It did not work.

Edit 3: I installed .NET 8.0.100-preview and Visual Studio version 17.8.0 preview 1, but I had no luck there either. I don t know what to try anymore. I should have tried to build the project in release mode before pouring weeks of development into my app. Is anyone else having this problem, and if so, how did you solve it?

<>蓬特顿风格:

<Style TargetType="Button" x:Key="ButtonStyle">
    <Setter Property="FontFamily" Value="OpenSansRegular"/>
    <Setter Property="FontSize" Value="16"/>
    <Setter Property="Padding" Value="10,10"/>

    <Setter Property="Margin" Value="5" />
    <Setter Property="MinimumHeightRequest" Value="65"/>
    <Setter Property="MinimumWidthRequest" Value="65"/>
    <Setter Property="BackgroundColor" Value="{StaticResource Primary}" />
    <Setter Property="TextColor" Value="{StaticResource Black}" />
    <Setter Property="CornerRadius" Value="10"/>
    <Setter Property="Shadow">
        <Setter.Value>
            <Shadow Brush="{StaticResource TertiaryBrush}" Offset="10,10" Radius="40" Opacity="0.80"/>
        </Setter.Value>
    </Setter>

    <Setter Property="VisualStateManager.VisualStateGroups">
        <VisualStateGroupList>
            <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal" />
                <VisualState x:Name="Disabled">
                    <VisualState.Setters>
                        <Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray950}, Dark={StaticResource Gray200}}" />
                        <Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray600}}" />
                    </VisualState.Setters>
                </VisualState>
            </VisualStateGroup>
        </VisualStateGroupList>
    </Setter>
</Style>
问题回答

我可以在此项目中重复你的问题。 我发现,文本Color将发生变化,但背景Color在我以释放方式测试时不会改变。

因此,我使用的是Background property,而不是BackgroundColor Property,并且是有效的。 例如:

<Style TargetType="Button" x:Key="ButtonStyle">
    <Setter Property="FontFamily" Value="OpenSansRegular"/>
    <Setter Property="FontSize" Value="16"/>
    <Setter Property="Padding" Value="10,10"/>

    <Setter Property="Margin" Value="5" />
    <Setter Property="MinimumHeightRequest" Value="65"/>
    <Setter Property="MinimumWidthRequest" Value="65"/>
    <Setter Property="Background" Value="{StaticResource Primary}" />
    <Setter Property="TextColor" Value="{StaticResource Black}" />
    <Setter Property="CornerRadius" Value="10"/>
    <Setter Property="Shadow">
        <Setter.Value>
            <Shadow Brush="{StaticResource TertiaryBrush}" Offset="10,10" Radius="40" Opacity="0.80"/>
        </Setter.Value>
    </Setter>

    <Setter Property="VisualStateManager.VisualStateGroups">
        <VisualStateGroupList>
            <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal" />
                <VisualState x:Name="Disabled">
                    <VisualState.Setters>
                        <Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray950}, Dark={StaticResource Gray200}}" />
                        <Setter Property="Background" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray600}}" />
                    </VisualState.Setters>
                </VisualState>
            </VisualStateGroup>
        </VisualStateGroupList>
    </Setter>
</Style>

欲了解更多情况,请参阅iOS和In releasemode的这个已知问题,在更改国时不会改变纽顿的背景。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签