Visual Studio 2017 Xamarin Form Preview Fails With System.Exception - Could Not Display Android XAML Preview

I am very new to Xamarin.Forms and I am trying to study this tutorial . I created an empty Xamarin.Forms, Portable Class Library in Visual Studio 2017, running on Windows 10 x64.

I have successfully written, compiled and decomposed the code from here on both an emulator and a real Android device. However, I have seen that XAML is not checked at compile time. I tried to open Forms Previewer but with error:

System.Exception - Failed to display Android XAML preview

JDK path is set correctly in Xamarin -> Android Settings for JDK 64bit: C:\Program Files\Java\jdk1.8.0_121

Event Viewer reports this error immediately after the viewer crashes:

Faulting application name: java.exe, version: 8.0.1210.13, time stamp: 0x584f5d7e
Faulting module name: libmonosgen-2.0.dll, version: 0.0.0.0, time stamp: 0x5818507d
Exception code: 0x40000015
Fault offset: 0x00000000002c96a1
Faulting process id: 0x4d28
Faulting application start time: 0x01d2a6c1cdfa70e9
Faulting application path: C:\Program Files\Java\jdk1.8.0_121\bin\java.exe
Faulting module path: C:\Program Files (x86)\MSBuild\Xamarin\Android\libmonosgen-2.0.dll
Report Id: 3562b40a-403a-416a-9531-e7c357aae7d6
Faulting package full name: 
Faulting package-relative application ID: 

      

Installed components

Microsoft Visual Studio Community 2017
Version 15.0.26228.9 D15RTWSVC
Microsoft .NET Framework
Version 4.6.01586

Installed Version: Community

Xamarin   4.3.0.784 (73f58d6)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android SDK   7.1.0.41 (9578cdc)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK   10.4.0.123 (35d1ccd)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

      

The question is, how can I overcome this error?

[EDIT]

The Xamarin bug tracker seems to have something about this bug , but no information is available (even if I have an account):

Error 53163

You are not allowed to view this error.

+3


source to share


1 answer


Thanks to the suggestion Almis

'and a little programming break, I was able to overcome this error:



  • I entered VS2015 (which was already installed prior to installing VS2017) and created an empty Xamarin.Forms project

  • VS2015 suggested updating Xamarin and accepting it. In addition, all other components offered in Tools -> Options -> Xamarin -> Other

    (stable) have been updated

  • (sanity check) VS2015 Working with Xamarin Form Preview

  • Reopening VS2017 and opening Xamarin Form Preview correctly

+1


source







All Articles