ComboBox causes UI to not load when testing in TestFlight

1 Answer 190 Views
ComboBox
Mark
Top achievements
Rank 3
Iron
Iron
Iron
Mark asked on 13 Jul 2023, 08:02 PM | edited on 14 Jul 2023, 04:13 PM

I have a MAUI desktop app that I have built using MAUI and Telerik controls,
It runs on Windows Desktop and in Windows deployed via the Microsoft Store,
It runs via Visual Studio on a Mac (Apple M2 Max)
However the UI does not load when running on the same Mac, deployed via TestFlight

I have systematically removed code from the project until I removed the Telerik controls.

I have this in the MauiProgram

var builder = MauiApp.CreateBuilder();
            builder
                .UseMauiApp<App>()
                .UseTelerik()
                .UseMauiCommunityToolkit()
                .ConfigureFonts(fonts =>
                {
                    fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
                    fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
                });

This at the ContentPage tag:
xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui"

and this Telerik component code (within a grid and HorizontalStackLayout with other standard controls):
<telerik:RadComboBox x:Name="WorkflowsComboBox"
                TextColor="White"
                HorizontalOptions="Start"
                DisplayMemberPath="Name"
                Placeholder="(select workflow)"
                PlaceholderColor="Black"
                BackgroundColor="Transparent"
                WidthRequest="600"
                Padding="0,3,0,0"
                Margin="10,3,10,3"
                BorderColor="#644E88">
            </telerik:RadComboBox>

The app runs without the above code and UI hangs with the above code?

Latest Visual Studio Mac version with the automatic workflows installed.

packages:
<ItemGroup>
		<PackageReference Include="CommunityToolkit.Maui" Version="5.2.0" />
		<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1" />
		<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="7.0.5" />
		<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
		<PackageReference Include="Polly.Extensions.Http" Version="3.0.0" />
		<PackageReference Include="Telerik.UI.for.Maui" Version="5.2.0" />
		<PackageReference Include="NLog.Targets.MauiLog" Version="5.*" />
		<PackageReference Include="NLog.Extensions.Logging" Version="5.*" />
	</ItemGroup>


Any ideas?

Note: The app will need to be run via TestFlight.

I am not getting any crash reports or error messages and trying to catch exceptions everywhere.

The UI simply doesnt show up, the ViewModel initializes, and runs code, including tasks on a timer (before removing most of that code to get the app working)

Please advise.
Lance | Manager Technical Support
Telerik team
commented on 14 Jul 2023, 01:10 PM | edited

Hi Mark, I saw your comment on a forum post about the RadListView and them moved it here. We'll continue the conversation here.

To make sure I understand correctly, this only happens when in TestFlight and Release build work locally? (Debug builds have optimizations turned off, so this isn't a good representation of a release deployment). I don't see anything wrong with the code itself.

Can you please check your build settings and make sure the linker is not stripping out external assemblies? The LinkerBehavior can sometimes remove code when build in Release mode, try setting it to SdkOnly

Mark
Top achievements
Rank 3
Iron
Iron
Iron
commented on 14 Jul 2023, 01:24 PM | edited

Hi Lance,

Thanks for your reply.

I have seen that setting (and may have tried it in the 90+ uploads to TesfFlight) when trying many other things, but will try it and report back.

You do mean changing:

<MtouchLink>Full</MtouchLink>

to

<MtouchLink>SdkOnly</MtouchLink>

I suspect it is a build thing and also suspect that I have added many settings that might have broken things in trying to get things working...

I am publishing the app via Visual Studio using the following publishing profile and have included the project file, in case you spto anything else obvious.

Thanks.

and this is the project file (showing <MtouchLink>Full</MtouchLink>) I will change that...
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>FileSystem</WebPublishMethod>
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
    <LastUsedPlatform>AnyCPU</LastUsedPlatform>
    <publishUrl>../../../../Desktop/Build/CloudRepro</publishUrl>
    <DeleteExistingFiles>false</DeleteExistingFiles>
    <TargetFramework>net7.0-maccatalyst</TargetFramework>
    <SelfContained>true</SelfContained>
    <_IsPortable>false</_IsPortable>
  </PropertyGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>

<OutputType>Exe</OutputType>
<RootNamespace>redacted</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>

<!-- Display name -->
<ApplicationTitle>redacted</ApplicationTitle>

<!-- App Identifier -->
<ApplicationId>redacted</ApplicationId>
<ApplicationIdGuid>redacted</ApplicationIdGuid>

<!-- Versions -->
<ApplicationDisplayVersion>redacted</ApplicationDisplayVersion>
<ApplicationVersion>redacted</ApplicationVersion>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
...
</PropertyGroup>

<PropertyGroup Condition="$(TargetFramework.Contains('-maccatalyst')) and '$(Configuration)' == 'Debug'">
<MtouchLink>None</MtouchLink>
<EnableCodeSigning>false</EnableCodeSigning>
<ProvisionType>Manual</ProvisionType>
<CreatePackage>false</CreatePackage>
<EnablePackageSigning>true</EnablePackageSigning>
<CodesignKey>redacted</CodesignKey>
<CodesignEntitlements>Platforms\MacCatalyst\Entitlements.plist</CodesignEntitlements>
<CodesignProvision>redacted</CodesignProvision>
<PackageSigningKey>redacted</PackageSigningKey>
<UseHardenedRuntime>false</UseHardenedRuntime>
</PropertyGroup>

<PropertyGroup Condition="$(TargetFramework.Contains('-maccatalyst')) and '$(Configuration)' == 'Release'">
<MtouchLink>Full</MtouchLink>
<RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers>
<EnableCodeSigning>True</EnableCodeSigning>
<ProvisionType>Manual</ProvisionType>
<CreatePackage>true</CreatePackage>
<EnablePackageSigning>true</EnablePackageSigning>
<CodesignEntitlements>Platforms\MacCatalyst\Entitlements.plist</CodesignEntitlements>
<CodesignKey>redacted</CodesignKey>
<CodesignProvision>CloudRepro</CodesignProvision>
<PackageSigningKey>redacted</PackageSigningKey>
<UseHardenedRuntime>true</UseHardenedRuntime>
<_LibMonoLinkMode>Static</_LibMonoLinkMode>
 <_LibXamarinLinkMode>Static</_LibXamarinLinkMode>
<EnableAssemblyILStripping>false</EnableAssemblyILStripping>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-maccatalyst|AnyCPU'">
 <ApplicationDisplayVersion>1.5.0</ApplicationDisplayVersion>
 <CodesignProvision></CodesignProvision>
 <CodesignKey>redacted</CodesignKey>
 <PackageSigningKey>redacted</PackageSigningKey>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net7.0-maccatalyst|AnyCPU'">
 <ApplicationDisplayVersion>1.5.0</ApplicationDisplayVersion>
</PropertyGroup>

...
</Project>

Thanks,
 

Mark

[edited by admin] removed potentially sensitive information

Mark
Top achievements
Rank 3
Iron
Iron
Iron
commented on 14 Jul 2023, 01:42 PM | edited

I updated the project release settings to:

<MtouchLink>SdkOnly</MtouchLink>

The app now crashes and closes with this error:

Thread 0 Crashed:: tid_103 Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib               0x19c3ac724 __pthread_kill + 8
1   libsystem_pthread.dylib             0x19c3e3c28 pthread_kill + 288
2   libsystem_c.dylib                   0x19c2f1ae8 abort + 180
3   CloudRepro                           0x109abb9d8 sigabrt_signal_handler.cold.1 + 48 (mini-posix.c:226)
4   CloudRepro                           0x109a7d574 sigabrt_signal_handler + 168 (mini-posix.c:224)
5   libsystem_platform.dylib             0x19c412a24 _sigtramp + 56
6   libsystem_pthread.dylib             0x19c3e3c28 pthread_kill + 288
7   libsystem_c.dylib                   0x19c2f1ae8 abort + 180
8   CloudRepro                           0x10975ed64 log_callback(char const*, char const*, char const*, int, void*) + 60 (runtime.m:1173)
9   CloudRepro                           0x109ab7884 monoeg_g_logstr + 44 (goutput.c:151) [inlined]
10  CloudRepro                           0x109ab7884 monoeg_g_logv_nofree + 136 (goutput.c:166) [inlined]
11  CloudRepro                           0x109ab7884 monoeg_g_logv + 172 (goutput.c:173)
12  CloudRepro                           0x109ab79b8 monoeg_g_log + 28 (goutput.c:182)
13  CloudRepro                           0x109a2d068 load_aot_module + 4252 (aot-runtime.c:2323)
14  CloudRepro                           0x1098cb744 mono_assembly_invoke_load_hook_internal + 92 (assembly.c:1083) [inlined]
15  CloudRepro                           0x1098cb744 mono_assembly_request_load_from + 1108 (assembly.c:2030)
16  CloudRepro                           0x1098cb260 mono_assembly_request_open + 488 (assembly.c:1635)
17  CloudRepro                           0x1098cce84 mono_assembly_open + 88 (assembly.c:1838)
18  CloudRepro                           0x10975e64c xamarin_open_assembly_or_assert(char const*) + 20 (runtime.m:924) [inlined]
19  CloudRepro                           0x10975e64c xamarin_open_assembly + 44 (runtime.m:962) [inlined]
20  CloudRepro                           0x10975e64c xamarin_open_and_register + 88 (runtime.m:1000)
21  CloudRepro                           0x109abb4a0 xamarin_register_assemblies_impl() + 36 (main.arm64.mm:272)
22  CloudRepro                           0x109766ca4 xamarin_main + 288 (monotouch-main.m:442)
23  CloudRepro                           0x109abb714 main + 64 (main.arm64.mm:340)
24  dyld                                 0x19c08bf28 start + 2236

REDACTED UNRELATED INFO

  "exception" : {"codes":"0x0000000000000000, 0x0000000000000000","rawCodes":[0,0],"type":"EXC_CRASH","signal":"SIGABRT"},
 
  "usedImages" : [
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4593483776,
    "CFBundleShortVersionString" : "1.0",
    "CFBundleIdentifier" : "com.microsoft.libSkiaSharp",
    "size" : 5324800,
    "uuid" : "4059998f-6625-3481-99ea-92cf314e1ea8",
    "path" : "\/Applications\/CloudRepro.app\/Contents\/Frameworks\/libSkiaSharp.framework\/Versions\/A\/libSkiaSharp",
    "name" : "libSkiaSharp",
    "CFBundleVersion" : "1"
  },

Lance | Manager Technical Support
Telerik team
commented on 14 Jul 2023, 02:06 PM

Hi Mark, correct "Full" will strip everything possible it can from the final assembly.  This is intentional because it removes unused code form the final package. However there is a downside that can happen when using 3rd party libraries... if the compiler cannot detect that reference, then the linker will remove that code from the final app causing runtime errors.

It is really weird that you're getting an exception after easing the linker's restrictions. It's usually the opposite. What happens if you set it to "None"?

The stack hints that the problem is with SkiaSharp. I will work on setting up my TestFlight account again to attempt to reproduce this, but it might take a couple days. I'll also ask the devs for any insight, 

Priority Note: I've noticed you've never opened a support ticket, so I'm not sure if you knew it was available. In the future, for time sensitive and/or non-community focused issues, I recommend opening a Support Ticket instead of a forum post. This is at 3x faster for response time. Of course, if you want to have the conversation in public to share the information with the rest of the community, this is the place to do it, it just may take more time to reply because tickets have a higher priority for the engineers.

Mark
Top achievements
Rank 3
Iron
Iron
Iron
commented on 14 Jul 2023, 02:12 PM | edited

I do have this Warning in Visual Studio

I believe this something included with Telerik?

 

I will submit a ticket in future..

Lance | Manager Technical Support
Telerik team
commented on 14 Jul 2023, 02:22 PM

Okay, so that explains why SkiaSharp crashes. I'll continue investigating full linking with the RadDatePicker. Are you able to share the XAML for the page that contains it? You can strip out the rest of the UI, I just need to see the relationship between the picker and it's parents. For example, this is the lrelevant part for me: DatePicker > in a Grid (with RowDefintion Height=Auto) > ContentPage

Technically speaking, I don't see why the linker would interfere with the RadDatePicker. Normally it's only a problem for native controls that are loaded with a MAUI handler (RadListView, Chart, etc). The RadDatePicker is a pure .NET MAUI component and shouldn't be affected, but I'll know more once I talk to the team and try to replicate in my TestFlight.

Lance | Manager Technical Support
Telerik team
commented on 14 Jul 2023, 02:25 PM

Mark, can you please run the following command in the CLI (PowerShell, Terminal, any) to let me know what version of .NET MAUI is being used: dotnet workload list

Mark
Top achievements
Rank 3
Iron
Iron
Iron
commented on 14 Jul 2023, 02:27 PM | edited

Here is the XAML, I basically commented out loads of things, specifically to remove any bindings etc when trying to get to the bottom of things., so should be simple enough...

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="CloudRepro.SplashPage"
             Title="SplashPage"
             xmlns:viewmodel="clr-namespace:CloudRepro.ViewModels"
             x:DataType="viewmodel:MainPageViewModel"
             xmlns:controls="clr-namespace:CloudRepro.Controls"
             xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui"
             Shell.NavBarIsVisible="false">

    <Grid >
        <Grid.RowDefinitions>
            <RowDefinition Height="45" />
            <RowDefinition Height="*" />
            <RowDefinition Height="45" />
            <RowDefinition Height="260" />
            <RowDefinition Height="45" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <HorizontalStackLayout Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="5" HorizontalOptions="CenterAndExpand">
            <Label Text="Workflow" HorizontalOptions="Center" VerticalOptions="Center" TextColor="White" Margin="10, 0, 10, 0" FontSize="25"/>

            <telerik:RadComboBox x:Name="WorkflowsComboBox"
                TextColor="White"
                HorizontalOptions="Start"
                DisplayMemberPath="Name"
                Placeholder="(select workflow)"
                PlaceholderColor="Black"
                BackgroundColor="Transparent"
                WidthRequest="600"
                Padding="0,3,0,0"
                Margin="10,3,10,3"
                BorderColor="#644E88">
            </telerik:RadComboBox>

            <Button Grid.Row="0" Grid.Column="0" HorizontalOptions="End" BackgroundColor="Transparent" TextColor="White" Text="Refresh"></Button>
        </HorizontalStackLayout>

        </StackLayout>
    </Grid>
</ContentPage>
[edit by admin] redacted unrelated code, for privacy and clarity
Mark
Top achievements
Rank 3
Iron
Iron
Iron
commented on 14 Jul 2023, 02:29 PM

Workload list

Installed Workload Id      Manifest Version      Installation Source

--------------------------------------------------------------------

maui-maccatalyst           7.0.92/7.0.100        SDK 7.0.300        

maui-ios                   7.0.92/7.0.100        SDK 7.0.300        

maui-android               7.0.92/7.0.100        SDK 7.0.300        

Lance | Manager Technical Support
Telerik team
commented on 14 Jul 2023, 02:48 PM

That's higher than the one we used to build UI for Maui 2023.2 with, and I'm starting to suspect this might be related. We built with 7.0.56 so that it doesn't force customers to upgrade.

We do have a service pack release coming out on Wednesday. I will test with both the current one you're using now and get it to replicate. Once that's broken, I will try again with the upcoming to release to see if that resolves it.

It will take me a day or two to get TestFlight and publishing done with the results. I have to regenerate all my certs, and setup TestFlight again. I cannot use the official Telerik product certitificates for this, so I appreciate your patience and understanding while I work on this.

In the meantime, you can explicitly set the MauiVersion in your csproj and do a Clean and Rebuild. This will build your app with that specific version.

Put this in the opening PropertyGroup in the csproj:

<MauiVersion>7.0.86</MauiVersion> (or <MauiVersion>7.0.56</MauiVersion> if you want to try with an earlier version)

Mark
Top achievements
Rank 3
Iron
Iron
Iron
commented on 14 Jul 2023, 02:52 PM

Hi,

Thanks for doing that, appreciated!

Mark
Lance | Manager Technical Support
Telerik team
commented on 14 Jul 2023, 02:53 PM

Can you please also let me know what the results were for the following tests, this will help guide my investigation

  • Setting the linker to "None"
  • Changing the MauiVersion

I do appreciate and understand that each time you test, you have to build a release, publish to Testflight and re-install it. So I don't ask these things lightly.

Mark
Top achievements
Rank 3
Iron
Iron
Iron
commented on 14 Jul 2023, 03:31 PM

Hi,

ok, tried changing to :

<MauiVersion>7.0.56</MauiVersion>

But got this error: (not sure those workloads are still installed and would need to look how to do that)

 

Changed to:

<MauiVersion>7.0.86</MauiVersion>
cleaned, removed bin / obj folders, restored Nugets and rebuilt / published, and updated to TestFlight..

Yes, this version worked! (95th time lucky.. this is the real number)

ok, so I had tried with a couple of previous versions of the Telerik controls, but had always updated VS and the workloads whener coming back to this project to reduce any issue..

I guess we need to watch these versions... Not sure if it's a pure versioning issue or something else? 

This is a good step forward and I can at least reconstruct the project for continued tests on both Windows and Mac..

not sure you if you still need to do anything now, but I will lookout for the newer versions and consider the MauiVersion...

Thanks for your help.



 

Lance | Manager Technical Support
Telerik team
commented on 14 Jul 2023, 04:20 PM

Hi Mark, as you've noticed, I've posted the solution as an Answer to this thread. This will allow anyone else who is having the same problem find this conversation more easily. I'm really happy to see that you're past the issue and can move forward.

As promised, I opened a bug report on your behalf => DatePicker: Not Visible on MacCatalyst when using Maui 7.0.92 (telerik.com). You will automatically get a notification when we update its status or post a message, so you don't have to manually check for updates.

Have a great weekend!

1 Answer, 1 is accepted

Sort by
1
Accepted
Lance | Manager Technical Support
Telerik team
answered on 14 Jul 2023, 04:05 PM

Hi Mark,

The solution is to explicitly choose .NET MAUI 7.0.86 for the project instead of implicitly using v.7.0.92. 

 

There must be a bug in .NET MAUI 7.0.92 that is causing this, so I have opened a Bug Report for the team to investigate further. It's likely Microsoft changed something in the latest SDK that we have to address if/when we build on top of 7.0.92+

Regards,
Lance | Manager Technical Support
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
ComboBox
Asked by
Mark
Top achievements
Rank 3
Iron
Iron
Iron
Answers by
Lance | Manager Technical Support
Telerik team
Share this question
or