verybadcat/CSharpMath

Xamarin: Should the LaTeX render in VS studio emulator?

pemby opened this issue · 5 comments

pemby commented

About info from VS

`Microsoft Visual Studio Community 2019
Version 16.10.2
VisualStudio.16.Release/16.10.2+31410.357
Microsoft .NET Framework
Version 4.8.03752

Installed Version: Community

ASP.NET and Web Tools 2019 16.10.526.50910
ASP.NET and Web Tools 2019

Azure App Service Tools v3.0.0 16.10.526.50910
Azure App Service Tools v3.0.0

C# Tools 3.10.0-4.21269.26+029847714208ebe49668667c60ea5b0a294e0fcb
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Extensibility Message Bus 1.2.6 (master@34d6af2)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

IntelliCode Extension 1.0
IntelliCode Visual Studio Extension Detailed Info

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Mono Debugging for Visual Studio 16.10.15 (552afdf)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager 5.10.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

TypeScript Tools 16.0.30429.2002
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 3.10.0-4.21269.26+029847714208ebe49668667c60ea5b0a294e0fcb
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 16.10.0-beta.21262.7+1b23bbeda88ea3cb9be9af777f4c99fa8663df81
Microsoft Visual F# Tools

Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

VisualStudio.DeviceLog 1.0
Information about my package

VisualStudio.Foo 1.0
Information about my package

VisualStudio.Mac 1.0
Mac Extension for Visual Studio

Xamarin 16.10.000.231 (d16-10@8111164)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 16.10.0.115 (remotes/origin/c750fbf1bde3c720d077f51640fe197c6dac7cbe@c750fbf1b)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 16.10.5 (355b57a)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 11.3.0.4 (d16-10/ae14caf)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: b4a3858
Java.Interop: xamarin/java.interop@f39db25
ProGuard: Guardsquare/proguard@912d149
SQLite: xamarin/sqlite@85460d3
Xamarin.Android Tools: xamarin/xamarin-android-tools@c5732a0

Xamarin.iOS and Xamarin.Mac SDK 14.20.0.10 (0e35b2e0b)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.`

Yes, it should. Can you give us more details? A small sample with expected and actual results would be perfect.

pemby commented

Sure thing! Please let me know if you need more or less info.

I am just using the default Xamarin App for a baseline.

\PPAVGCALC\PPAVGCALC\PPAVGCALC\MainPage.xaml.cs

    <?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:math="clr-namespace:CSharpMath.Forms;assembly=CSharpMath.Forms"
                 x:Class="PPAVGCALC.MainPage">
        <StackLayout>
            <Frame BackgroundColor="#2196F3" Padding="24" CornerRadius="0">
                <Label Text="Welcome to Xamarin.Forms!" HorizontalTextAlignment="Center" TextColor="White" FontSize="36"/>
            </Frame>
            <Label Text="Start developing now" FontSize="Title" Padding="30,10,30,10"/>
            <Label Text="Make changes to your XAML file and save to see your UI update in the running app with XAML Hot Reload. Give it a try!!!!!" FontSize="16" Padding="30,0,30,0"/>
            <Label Text="Make changes to your XAML file and save to see your UI update in the running app with XAML Hot Reload. Give it a try!!!!!!!!!!!" FontSize="16" Padding="30,0,30,0"/>
            <math:MathView x:Name="View" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
                \frac\sqrt23
            </math:MathView>
            <Label FontSize="16" Padding="30,24,30,0">
                <Label.FormattedText>
                    <FormattedString>
                        <FormattedString.Spans>
                            <Span Text="Learn more at "/>
                            <Span Text="https://aka.ms/xamarin-quickstart" FontAttributes="Bold"/>
                        </FormattedString.Spans>
                    </FormattedString>
                </Label.FormattedText>
            </Label>
        </StackLayout>
    </ContentPage>

Screenshot of nuget packages.

image

Screenshot of the screen [extra line of text added to test if text is rendering]

image

Warning copy paste.

Severity    Code    Description Project File    Line    Suppression State
Warning     MSB3277: Found conflicts between different versions of "System.Numerics.Vectors" that could not be resolved.
There was a conflict between "System.Numerics.Vectors, Version=2.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
    "System.Numerics.Vectors, Version=2.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was chosen because it was primary and "System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was not.
    References which depend on "System.Numerics.Vectors, Version=2.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Numerics.Vectors.dll].
        C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Numerics.Vectors.dll
          Project file item includes which caused reference "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Numerics.Vectors.dll".
            System.Numerics.Vectors
    References which depend on "System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [].
        C:\Users\[userNameOmitted]\.nuget\packages\csharpmath.rendering\0.5.1\lib\netstandard2.0\CSharpMath.Rendering.dll
          Project file item includes which caused reference "C:\Users\[userNameOmitted]\.nuget\packages\csharpmath.rendering\0.5.1\lib\netstandard2.0\CSharpMath.Rendering.dll".
            C:\Users\[userNameOmitted]\.nuget\packages\csharpmath.rendering\0.5.1\lib\netstandard2.0\CSharpMath.Rendering.dll
            C:\Users\[userNameOmitted]\.nuget\packages\csharpmath.forms\0.5.1\lib\netstandard2.0\CSharpMath.Forms.dll
            C:\Users\[userNameOmitted]\source\repos\PPAVGCALC\PPAVGCALC\PPAVGCALC\bin\Debug\netstandard2.0\PPAVGCALC.dll
            C:\Users\[userNameOmitted]\.nuget\packages\csharpmath.skiasharp\0.5.1\lib\netstandard2.0\CSharpMath.SkiaSharp.dll          0   
Warning NU1605  Detected package downgrade: Xamarin.Forms from 5.0.0.2083 to 5.0.0.2012. Reference the package directly from the project to select a different version. 
 PPAVGCALC.iOS -> PPAVGCALC -> Xamarin.Forms (>= 5.0.0.2083) 
 PPAVGCALC.iOS -> Xamarin.Forms (>= 5.0.0.2012)         1   
Warning NU1605  Detected package downgrade: Xamarin.Forms from 5.0.0.2083 to 5.0.0.2012. Reference the package directly from the project to select a different version. 
 PPAVGCALC.Android -> PPAVGCALC -> Xamarin.Forms (>= 5.0.0.2083) 
 PPAVGCALC.Android -> Xamarin.Forms (>= 5.0.0.2012)         1   
Warning NU1605  Detected package downgrade: Xamarin.Essentials from 1.7.0 to 1.6.1. Reference the package directly from the project to select a different version. 
 PPAVGCALC.iOS -> PPAVGCALC -> Xamarin.Essentials (>= 1.7.0) 
 PPAVGCALC.iOS -> Xamarin.Essentials (>= 1.6.1)         1   
Warning NU1605  Detected package downgrade: Xamarin.Essentials from 1.7.0 to 1.6.1. Reference the package directly from the project to select a different version. 
 PPAVGCALC.Android -> PPAVGCALC -> Xamarin.Essentials (>= 1.7.0) 
 PPAVGCALC.Android -> Xamarin.Essentials (>= 1.6.1)         1   

Thank you, that's better. Indeed, it doesn't display correctly on Android emulator (didn't check on a real device) for me as well. I can't immediately say what's wrong here but I'll try to take a look tomorrow.

pemby commented

I think it may have something to do with the conflict of vector libraries.

I am not sure how to or what option is the better one, concerning a version conflict.
I think there are 2^2 combinations of settings. I am not sure if that is something you can help with.

Thank you for any insight.
Best

I'm having the same issue. I create a brand new xamarin forms app, I added the CSharp Nuget packages, I run it on UWP and it works fine. I run it on the android emulator and it doesn't show the latex