Problem with RadButton and Windows 10 Version 1809

11 posts, 0 answers
  1. John
    John avatar
    10 posts
    Member since:
    Jan 2019

    Posted 11 Mar Link to this post

    I just upgraded from Windows 10 version 1803 to version 1809 on my development machine, because my Xamarin app was crashing on machines with 1809. Sure enough, after upgrading, Visual Studio would build the app but crash immediately with a XAML Uncaught Exception error and give me no information to go on.

    After isolating various bits of code, I found the culprit to be any ContentView with a RadButton in it. If I comment out all of the RadButtons, the code works fine as it did in version 1803 (minus any buttons :-/ ).

    Does anybody have any ideas about why this would be happening and/or a workaround other than replacing all my RadButtons?

  2. John
    John avatar
    10 posts
    Member since:
    Jan 2019

    Posted 11 Mar in reply to John Link to this post

    UPDATE: OK, for now I have had to use the generic Xamarin Button class and the app works as expected with just a bit of UI ugliness.  Any chance when this issue can be investigated / fixed in the Telerik nuget?

  3. Lance | Technical Support Engineer, Principal
    Admin
    Lance | Technical Support Engineer, Principal avatar
    1020 posts

    Posted 12 Mar Link to this post

    Hi John,

    I'm not aware of any issues with RadButton on UWP with a Target SDK 1809. 

    Can you check the following:

    - Make sure you're using a single Telerik NuGet package Telerik.ui.for.Xamain and not the sub-packages
    - Make sure the UWP Core package is on 6.1.9 (there are serious problems with 6.2.x that MSFT is aware of)
    - Make sure Xamarin.Forms is on 3.4.0.1029999 or later
    - Make sure all the SkiaSharp packages are installed and on 1.59.3 or 1.68 (do not use 1.60 there's a bug in there, too)

    If you can share the following information, I'll investigate directly:

    - The two csproj files (class library and UWP). You can strip out identifying info, I'm mainly interested in the build settings and PackageReference settings
    - The XAML for the Radbutton

    With that info, I can built a test app to try and reproduce the problem on my end.

    Regards,
    Lance | Technical Support Engineer, Principal
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  4. John
    John avatar
    10 posts
    Member since:
    Jan 2019

    Posted 19 Mar in reply to Lance | Technical Support Engineer, Principal Link to this post

    Single Telerik nuget - check

    UWP Core: I am using 6.2.8 and downgrading is causing me some other issues..

    Xamarin.Forms>3.4.0.102999 - Check

    SkiaSharp packages - this seems a little tricky. I just installed your latest Telerik UI update (2019.1.318.1) and it seems to use SkiaSharp 1.60.0 as a dependency?? Plus, I use a package called SkiaSharp.Svg that also seems to be using 1.60.0. I'm not finding a way to change SkiaSharp to any other version either. I don't have it installed directly, but rather through those two packages, the Svg and the Telerik packages.

     

    I've included all relevant files, there are 3. There is an extra class library that is shared between two other Xamarin.Forms apps I'll call "Parent", then the Xamarin.Forms app "Child" and it's Child.UWP variant. Build inheritance is therefore: Parent -> Child -> Child.UWP

     

    Thanks for your help. I hope we can determine if there is a workable solution. Not having the RadButton isn't THAT big of an issue, but I do like the formatting options :-)

    (deleting unnecessary EmbeddedResources, etc., for our purpposes)

    Parent.csproj:

    <Project Sdk="Microsoft.NET.Sdk">

      <PropertyGroup>
        <TargetFramework>netstandard2.0</TargetFramework>
        <Configurations>Debug;Release;</Configurations>
      </PropertyGroup>

      <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
        <DebugType>pdbonly</DebugType>
        <DebugSymbols>true</DebugSymbols>
      </PropertyGroup>

      <ItemGroup>
        <PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
        <PackageReference Include="SkiaSharp.Svg" Version="1.60.0" />
        <PackageReference Include="System.Management" Version="4.5.0" />
        <PackageReference Include="Telerik.UI.for.Xamarin" Version="2019.1.318.1" />
        <PackageReference Include="Xamarin.Essentials" Version="1.1.0" />
        <PackageReference Include="Xamarin.Forms" Version="3.6.0.220655" />
        <PackageReference Include="zetetic-sqlite-net-base" Version="4.0.1" />
      </ItemGroup>

    </Project>

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

    Child.csproj

    <Project Sdk="Microsoft.NET.Sdk">

      <PropertyGroup>
        <TargetFramework>netstandard2.0</TargetFramework>
        <Configurations>Debug;Release;</Configurations>
      </PropertyGroup>

      <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
        <DebugType>pdbonly</DebugType>
        <DebugSymbols>true</DebugSymbols>
      </PropertyGroup>

      <ItemGroup>
        <PackageReference Include="Telerik.UI.for.Xamarin" Version="2019.1.318.1" />
        <PackageReference Include="Xamarin.Controls.SignaturePad.Forms" Version="3.0.0" />
        <PackageReference Include="Xamarin.Essentials" Version="1.1.0" />
        <PackageReference Include="Xamarin.Forms" Version="3.6.0.220655" />
        <PackageReference Include="ZXing.Net.Mobile.Forms" Version="2.4.1" />
      </ItemGroup>

    </Project>

     

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

    Child.UWP.csproj:

    <?xml version="1.0" encoding="utf-8"?>
    <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
      <PropertyGroup>
        <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
        <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
        <ProjectGuid>{ACAF8526-B30F-44C3-9FEC-DB0E2CCA7FA5}</ProjectGuid>
        <OutputType>AppContainerExe</OutputType>
        <AppDesignerFolder>Properties</AppDesignerFolder>
        <RootNamespace>Child.UWP</RootNamespace>
        <AssemblyName>Child.UWP</AssemblyName>
        <DefaultLanguage>en-US</DefaultLanguage>
        <TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
        <TargetPlatformVersion>10.0.17763.0</TargetPlatformVersion>
        <TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion>
        <MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
        <EnableDotNetNativeCompatibleProfile>true</EnableDotNetNativeCompatibleProfile>
        <FileAlignment>512</FileAlignment>
        <PackageCertificateKeyFile>
        </PackageCertificateKeyFile>
        <GenerateAppInstallerFile>False</GenerateAppInstallerFile>
        <AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
        <AppxBundle>Always</AppxBundle>
        <AppxBundlePlatforms>x86</AppxBundlePlatforms>
        <AppInstallerUpdateFrequency>1</AppInstallerUpdateFrequency>
        <AppInstallerCheckForUpdateFrequency>OnApplicationRun</AppInstallerCheckForUpdateFrequency>
        <AppxSymbolPackageEnabled>False</AppxSymbolPackageEnabled>
      </PropertyGroup>
      <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
        <DebugSymbols>true</DebugSymbols>
        <OutputPath>bin\ARM\Debug\</OutputPath>
        <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
        <NoWarn>;2008</NoWarn>
        <DebugType>full</DebugType>
        <PlatformTarget>ARM</PlatformTarget>
        <UseVSHostingProcess>false</UseVSHostingProcess>
        <ErrorReport>prompt</ErrorReport>
        <Prefer32Bit>true</Prefer32Bit>
      </PropertyGroup>
      <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
        <OutputPath>bin\ARM\Release\</OutputPath>
        <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
        <Optimize>true</Optimize>
        <NoWarn>;2008</NoWarn>
        <DebugType>pdbonly</DebugType>
        <PlatformTarget>ARM</PlatformTarget>
        <UseVSHostingProcess>false</UseVSHostingProcess>
        <ErrorReport>prompt</ErrorReport>
        <Prefer32Bit>true</Prefer32Bit>
        <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
      </PropertyGroup>
      <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
        <DebugSymbols>true</DebugSymbols>
        <OutputPath>bin\x64\Debug\</OutputPath>
        <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
        <NoWarn>;2008</NoWarn>
        <DebugType>full</DebugType>
        <PlatformTarget>x64</PlatformTarget>
        <UseVSHostingProcess>false</UseVSHostingProcess>
        <ErrorReport>prompt</ErrorReport>
        <Prefer32Bit>true</Prefer32Bit>
      </PropertyGroup>
      <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
        <OutputPath>bin\x64\Release\</OutputPath>
        <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
        <Optimize>true</Optimize>
        <NoWarn>;2008</NoWarn>
        <DebugType>pdbonly</DebugType>
        <PlatformTarget>x64</PlatformTarget>
        <UseVSHostingProcess>false</UseVSHostingProcess>
        <ErrorReport>prompt</ErrorReport>
        <Prefer32Bit>true</Prefer32Bit>
        <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
      </PropertyGroup>
      <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
        <DebugSymbols>true</DebugSymbols>
        <OutputPath>bin\x86\Debug\</OutputPath>
        <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
        <NoWarn>;2008</NoWarn>
        <DebugType>full</DebugType>
        <PlatformTarget>x86</PlatformTarget>
        <UseVSHostingProcess>false</UseVSHostingProcess>
        <ErrorReport>prompt</ErrorReport>
        <Prefer32Bit>true</Prefer32Bit>
      </PropertyGroup>
      <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
        <OutputPath>bin\x86\Release\</OutputPath>
        <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
        <Optimize>true</Optimize>
        <NoWarn>;2008</NoWarn>
        <DebugType>pdbonly</DebugType>
        <PlatformTarget>x86</PlatformTarget>
        <UseVSHostingProcess>false</UseVSHostingProcess>
        <ErrorReport>prompt</ErrorReport>
        <Prefer32Bit>true</Prefer32Bit>
        <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
      </PropertyGroup>
      <ItemGroup>
        <Compile Include="App.xaml.cs">
          <DependentUpon>App.xaml</DependentUpon>
        </Compile>
        <Compile Include="Database\DatabaseService_UWP.cs" />
        <Compile Include="Files\FileHelper_UWP.cs" />
        <Compile Include="MainPage.xaml.cs">
          <DependentUpon>MainPage.xaml</DependentUpon>
        </Compile>
        <Compile Include="Printing\PrintHelper_UWP.cs" />
        <Compile Include="Properties\AssemblyInfo.cs" />
      </ItemGroup>
      <ItemGroup>
        <AppxManifest Include="Package.appxmanifest">
          <SubType>Designer</SubType>
        </AppxManifest>
      </ItemGroup>

      <ItemGroup>
        <ApplicationDefinition Include="App.xaml">
          <Generator>MSBuild:Compile</Generator>
          <SubType>Designer</SubType>
        </ApplicationDefinition>
        <Page Include="MainPage.xaml">
          <Generator>MSBuild:Compile</Generator>
          <SubType>Designer</SubType>
        </Page>
      </ItemGroup>
      <ItemGroup>
        <PackageReference Include="Telerik.UI.for.Xamarin">
          <Version>2019.1.318.1</Version>
        </PackageReference>
        <PackageReference Include="Xamarin.Controls.SignaturePad.Forms">
          <Version>3.0.0</Version>
        </PackageReference>
        <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.8" />
        <PackageReference Include="Xamarin.Essentials">
          <Version>1.1.0</Version>
        </PackageReference>
        <PackageReference Include="Xamarin.Forms">
          <Version>3.6.0.220655</Version>
        </PackageReference>
        <PackageReference Include="zetetic-sqlcipher-windows-uap">
          <Version>4.0.1</Version>
        </PackageReference>
        <PackageReference Include="ZXing.Net.Mobile.Forms">
          <Version>2.4.1</Version>
        </PackageReference>
      </ItemGroup>
      <ItemGroup>
        <ProjectReference Include="..\Parent\Parent.csproj">
          <Project>{89aa68d5-679f-4d2b-a9c0-eaf768e3bb94}</Project>
          <Name>Parent</Name>
        </ProjectReference>
        <ProjectReference Include="..\Child\Child.csproj">
          <Project>{0AAB7F3B-E0F3-4675-9B9C-6CFE8E7AE253}</Project>
          <Name>Child</Name>
        </ProjectReference>
      </ItemGroup>

      <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
        <VisualStudioVersion>14.0</VisualStudioVersion>
      </PropertyGroup>
      <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Legacy|ARM'">
        <OutputPath>bin\ARM\Legacy\</OutputPath>
      </PropertyGroup>
      <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Legacy|x64'">
        <OutputPath>bin\x64\Legacy\</OutputPath>
      </PropertyGroup>
      <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Legacy|x86'">
        <OutputPath>bin\x86\Legacy\</OutputPath>
      </PropertyGroup>
      <PropertyGroup>
        <SignAssembly>false</SignAssembly>
      </PropertyGroup>
      <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
    </Project>

     

     

     

     

  5. John
    John avatar
    10 posts
    Member since:
    Jan 2019

    Posted 19 Mar in reply to John Link to this post

    I accidentaly deleted this from Child.csproj:

      <ItemGroup>
        <ProjectReference Include="..\Parent\Parent.csproj" />
      </ItemGroup>

  6. Lance | Technical Support Engineer, Principal
    Admin
    Lance | Technical Support Engineer, Principal avatar
    1020 posts

    Posted 19 Mar Link to this post

    Hi John,

    It looks like these projects do not list SkiaSharp packages explicitly. This is generally okay when using VS2017 on PC because the NuGet package manager will automatically pull in the dependencies, but I think there might be a conflict occurring.

    I would recommend manually installing, and updating existing SkiaSharp packages, to 1.68.

    Quick Fix Tip

    In your case, as you experienced, this is not easily done in the NuGet Package Manager because of the cross dependencies cancelling the update. Instead, it's much faster and easier just to edit the csproj files of every project to use v 1.68 and then reopen it in Visual Studio.

    Let me walk you through it:

    1. Close Visual Studio
    2. Go to the solution in File Explorer and open every project's csproj file (in NotePad or any text editor)
    3. Locate SkiaSharp package references and manually change the version numbers to 1.68
    4. Explicitly list the other SkiaSharp packages (highlighted below)
    5. Open the solution in Visual Studio again and do a Rebuild All.

    Package References

    Class library needs these:

    <ItemGroup>
        <PackageReference Include="Telerik.UI.for.Xamarin" Version="2019.1.318.1" />
        <PackageReference Include="SkiaSharp" Version="1.68.0" />
        <PackageReference Include="SkiaSharp.Svg" Version="1.68.0" />
        <PackageReference Include="SkiaSharp.Views.Forms" Version="1.68.0" />
     
    ... other packages...
      </ItemGroup>

    Platform-target (UWP, Android and iOS) csproj files need these:

    <ItemGroup>
        <PackageReference Include="Telerik.UI.for.Xamarin" Version="2019.1.318.1" />
        <PackageReference Include="SkiaSharp" Version="1.68.0" />
        <PackageReference Include="SkiaSharp.Views" Version="1.68.0" />
        <PackageReference Include="SkiaSharp.Views.Forms" Version="1.68.0" />
     
    ... other packages...
      </ItemGroup>

    Regarding the "Parent" and"Child" class library projects, I'm not sure what going on there. Do you have multiple Xamarin.Forms solutions sharing base resources? Is the Parent a controls library?

    Further Investigation

    If this still doesn't help, we'll need to dig deeper. To do this we'll need to continue this conversation in a Support Ticket. You can open a Support Ticket here and attach the solution as a ZIP file. You can also mention that the ticket is to continue an investigation started in this forum thread.

    Before zipping up the Solution, please take a moment to delete the bin and obj folder from each project. This will drastically reduce the ZIP size from hundreds of MBs to < 40MB.

    With that I'll be able to directly investigate and offer concrete solutions.

    Regards,
    Lance | Technical Support Engineer, Principal 
    Progress Telerik 
  7. John
    John avatar
    10 posts
    Member since:
    Jan 2019

    Posted 24 Mar in reply to Lance | Technical Support Engineer, Principal Link to this post

    Hi Lance, I've worked with your suggestions and had no luck, so I decided to start a fresh project and figure out at what point the project actually breaks. It is when I change the target version of Windows to version 1809 in the UWP project. After that, I get a run-time error with any RadButton.

    Steps to re-create:

    1) Started a new project with the normal Xamarin template (NOTE: I did NOT use the telerik template, as I need to be on .NET Standard 2.0 and not .NET Framework x.x.x

    2) I installed latest Telerik UI for Xamarin (2019.1.318.1)

    3) Added two lines of code into the Common code's MainPage.xaml to get this:

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

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:local="clr-namespace:App1"
                 xmlns:telerikInput="clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input"
                 x:Class="App1.MainPage">
        <StackLayout>
            <!-- Place new controls here -->
            <Label Text="Welcome to Xamarin.Forms!" 
               HorizontalOptions="Center"
               VerticalOptions="CenterAndExpand" />
            <telerikInput:RadButton Text="RadButton Test"/>
        </StackLayout>
    </ContentPage>

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

    So far, so good. All worked.

    4) Upgraded Xamarin.Forms all the way to it's Latest stable version (3.6.0.264807) across entire platform .. still all good.

    5) Upgraded Microsoft.NetCore.UniversalWindowsPlatform from the version it was on from the template (6.1.?) to 6.2.8 .. still all good.

    6) Like my other project, I installed SkiaSharp.Svg version 1.60.0 for App1.csproj only. Still RadButton worked fine.

    7) Changed the target version of App1.UWP.csproj from Win10 16299 to version 1809 (build 17763).

    This is where I receive the run-time error during what appears to be the InitializeComponent() method in MainPage.xaml.cs

    8) To further isolate the issue, I removed the SkiaSharp.Svg nuget. Same problem exists, so it has to be because I'm targeting 1809.

    9) I noticed Telerik UI was still using SkiaSharp version 1.59.3 as a dependency, so as a further test, I installed SkiaSharp version 1.68.0 directly into every project. Same issue.

    10) I noticed that under Telerik UI, SkiaSharp was using 1.68.0 but SkiaSharp.Views.Forms was still 1.59.3, so I installed SkiaSharp.Views nuget version 1.68.0 also. I received a warning that it was restored using .NET Framework 4.6.3 instead of .NET Core and may not be compatible. I noticed Telerik UI still listed SkiaSharp.Views.Forms as 1.59.3 after this. Screenshot attached. No luck when running.

    11) I downgraded the Windows 10 Target Version to 1803. It worked as expected.

    As a final test, I started another project using Telerik's Xamarin template, checked, it was targeting 1809 by default. I built and ran, everything worked fine. I replaced the default label with this RadButton: <telerikInput:RadButton Text="RadButton Test"/>

    in to the portable code's MainPage.xaml and did nothing else. Project built and had the same run-time error.

    I believe this strips the problem down to it's essence. It is definitely a problem with something inside RadButton when targeting version 1809.

     

     

     

     

  8. John
    John avatar
    10 posts
    Member since:
    Jan 2019

    Posted 24 Mar in reply to John Link to this post

    @Lance: FYI I went ahead and started a support ticket. I uploaded the test project as a .zip
  9. Yana
    Admin
    Yana avatar
    4873 posts

    Posted 27 Mar Link to this post

    Hello,

    We have researched the reported exception and logged a bug report regarding it here:
    https://feedback.telerik.com/xamarin/1402384-button-uwp-argumentexception-is-raised-when-targeting-windows-10-version-1809

    The issue concerns some changes of the border thickness of the native UWP Button in version 1809, so in order to workaround it until we provide a fix, please set BorderThickness property of RadButton:

    <telerikInput:RadButton Text="RadButton Test" BorderThickness="0"/>

    Regards,
    Yana
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  10. Martijn
    Martijn avatar
    1 posts
    Member since:
    Mar 2019

    Posted 28 May in reply to Yana Link to this post

    Hi Yana,

    I've got the same problem with the same error. However: the workaround isn't working for me. This fixes the errors on the UWP side but when using rounded corners and setting borderthickness this reverts the rounded corners effect on Android.

     

    Any solutions to this?

    Regards,

    Martijn

  11. Lance | Technical Support Engineer, Principal
    Admin
    Lance | Technical Support Engineer, Principal avatar
    1020 posts

    Posted 28 May Link to this post

    Hello Martijn,

    You can set the BorderWidth property to 0 to resolve that issue, here's an example:

    <telerikInput:RadButton Text="My Button"
                    TextColor="WhiteSmoke"
                    BackgroundColor="CornflowerBlue"
                    BorderThickness="0"
                    BorderWidth="0"
                    WidthRequest="100"
                    HeightRequest="33"
                    CornerRadius="25"/>

    Regards,
    Lance | Technical Support Engineer, Principal
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top