Colors are not working in maui release mode

Satya 85 Reputation points
2023-05-26T09:03:18.01+00:00

I have migrated the Xamarin forms app to .NET MAUI.

In Debug mode, app works fine but not in release mode.(Android API 33).
Color, Text Color, Background Color etc, are not working in MAUI release mode.

I have used/binded these properties through ViewModel/VisualState/Triggers at so many places.

Is there any Handler/Renderer way so that I can write one place and fixes everywhere.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,856 questions
0 comments No comments
{count} votes

Accepted answer
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 68,261 Reputation points Microsoft Vendor
    2023-05-29T03:51:24.54+00:00

    Hello,

    This issue is reported in the MAUI GitHub page:Some properties not updating (eg VisualState setter not working for Button BackgroundColor) with AOT enabled #11662

    And I notice you have added comments in this thread. Please waiting for mattleibow's update about using ViewHandler.

    Or you can disable the AOT by adding <RunAOTCompilation>false</RunAOTCompilation> in the .csproj file. Then release an APK file. It is working in my side.

    Best Regards,

    Leon Lu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful