Xamarin Forms Previewer isn't showing

I am using xamarin forms v2.3.2.127 stable on Visual Studio 2015 Community Edition in Windows 10 Operating System. Everytime I try to open the xaml, the Xamarin Forms Previewer did not show anything just blue box like the screenshot below. I have also try to create new project even in the latest pre-release channel but it still the same.

Best Answer

«1

Answers

  • DiegoMDiegoM USMember

    I'm having the same problem here. Even though my colleague can use properly the previewer on Xamarin Studio, it doesn't seems to work on Visual Studio for me

  • xCyborgxCyborg USMember ✭✭

    @DiegoM said:
    I'm having the same problem here. Even though my colleague can use properly the previewer on Xamarin Studio, it doesn't seems to work on Visual Studio for me

    XS on windows or Mac?

  • DiegoMDiegoM USMember
    edited September 2016

    @xCyborg said:

    @DiegoM said:
    I'm having the same problem here. Even though my colleague can use properly the previewer on Xamarin Studio, it doesn't seems to work on Visual Studio for me

    XS on windows or Mac?

    It works on XS on Mac i didn't tried on XS Windows (is there a way to download it ? I only have Xamarin for VS)

    EDIT : Just checked on MonoDevelop.com for XS Windows. I'll try it and see if it's working on it.

    EDIT 2 : On XS Windows i don't have the button for Preview (XS 6.1)

  • KramarKramar USMember

    I am having the exact same problem in Visual Studio.
    Works fine in XS on Mac.

    Note: Have not tried XS in Windows. I thought support for this was ending?

  • xCyborgxCyborg USMember ✭✭

    @Kramar said:
    I am having the exact same problem in Visual Studio.
    Works fine in XS on Mac.

    Note: Have not tried XS in Windows. I thought support for this was ending?

    Really? How?

  • KramarKramar USMember
    edited September 2016

    @xCyborg said:

    @Kramar said:
    I am having the exact same problem in Visual Studio.
    Works fine in XS on Mac.

    Note: Have not tried XS in Windows. I thought support for this was ending?

    Really? How?

    Which part of my post are you referring to? :)

  • Coruscate5Coruscate5 USMember
    edited September 2016

    I'm having this issue as well - I just began using the Previewer for XAML Xamarin.Forms so I'm unsure if it was working in a previous release for my setup.

    VS 2015 (Enterprise) on Windows 10

    @xCyborg said:

    @Kramar said:
    I am having the exact same problem in Visual Studio.
    Works fine in XS on Mac.

    Note: Have not tried XS in Windows. I thought support for this was ending?

    Really? How?

    I can't even find the Xamarin Studio for Windows link (if it exists) on the Downloads page - IIRC it got overhauled some time after the acquisition. Looks like the main products being promoted are Xamarin + VS, & Xamarin Studio for Mac.

  • FernandoVMFernandoVM BRMember ✭✭

    I'm having this same issue, my environment is Microsoft Windows 10 Enterprise (10.0.10586 Compilação 10586) and Microsoft Visual Studio Enterprise 2015 (Version 14.0.25431.01 Update 3).

    I have created a demo "Blank App (Xamarin.Forms Portable)" and, following the instructions of "https://developer.xamarin.com/guides/xamarin-forms/xaml/xaml-previewer/", I updated the Xamarin.Forms with the latest NuGet package, the version "2.3.2.127", but unfortunately the Preview is not working as expected. :neutral: :neutral:

    Following the topic "XAML Preview isn't showing" I already check the items:

    • Project should be built (compiled) before attempting to preview XAML files;
    • Try closing and re-opening the XAML file;

    The item "The Designer Agent must be set-up the first time you preview a XAML file" is only for iOS, correct? I would be happy if it worked at least for Android.

    But nothing, I always see a "blue screen" in the Preview as @BrianLee.7687. What more I can do? How I can investigate this issue? I can't find debug messages or logs, there is not a button to reload/refresh, ... :neutral: :neutral:

    Can anyone help?

  • JonatasCunhaJonatasCunha USMember
    edited September 2016

    Estou com o mesmo problema, alguém pode nós ajudar?

  • softlionsoftlion FRBeta ✭✭✭

    +1 not showing at all. Does it needs a specifi edition of Xamarin ?

  • VulcanVulcan TWMember ✭✭✭

    Upgrade lastest Xamarin for Visual Studio ( 4.2.0.695) and you need a Mac that connect with Xamarin Mac Agent.
    It is work fine.

  • prashantvcprashantvc USXamarin Team Xamurai
    edited October 2016

    The XAML previewer quite stable in the latest Xamarin release (v4.2.0.695) , please follow the ^ @vulcanlee's instructions for the fix

    Please note that XAML Previewer is still in preview, you can file a bug at http://bugzilla.xamarin.com when come across any issues

  • PierceBogganPierceBoggan USForum Administrator, Xamarin Team, Developer Group Leader Xamurai

    Just to add to what @prashantvc said, if you're hitting any issues with anything related to the Xamarin.Forms Previewer please file a bug at https://bugzilla.xamarin.com/newbug with as much information as you can provide (sample reproduction project, IDE logs, version information). This will increase the visibility to our engineers to help get the issue fixed. :smile:

  • SarunasKSarunasK LTMember

    ^ i have the same issue the setup is the same.

  • BenKBenK USMember

    Just wanted to say I'm having the same issue and I see a bug is already tracked in the system. I'm starting a new project and checking out my options for cross-platform mobile development and the inability to even view the UI you're building is not really winning points.

  • softlionsoftlion FRBeta ✭✭✭

    Maybe it's not a bug. I checked the Xamarin Logs and it says i'm using community edition, not business edition, because the version of Xamarin used was released after my subscription expired (it should not have exprired as it started in december 2015).

    So maybe the xaml forms previewer just don't work in community edition.

  • softlionsoftlion FRBeta ✭✭✭

    I found the solution and the log file.

    Solution:

    • update your Android NDK to r12b (i had r10e) and specify this sdk path in Tools > Options > Xamarin > Android
    • clear the current user's temp folder C:\Users(your login name)\AppData\Local\Temp
    • restart VS

    Log file:

    • use VS help menu, Xamarin > Logs. Open the last .svclog file
  • softlionsoftlion FRBeta ✭✭✭

    Note that now the previewer should work, it only displays false errors in a yellow bar and won't render anything: "an android application project must reference the project containing this xaml file in order to render in the previewer" (it is), "Java.Lang.Exception", "Invalid Xaml" (which works on device), becomes fully red with "XFPageRendererView" written in the middle, ...

    Note that it seems to require a Mac connection, even to display for Android only.

    I also froze VS a few seconds by switching device and platform too fast in the previewer. And crashed VS when switching xaml tabs.

  • VulcanVulcan TWMember ✭✭✭
    edited September 2016

    That is my XAML Previewer operating Video and VS2015 About Information.
    My demo need Mac connection.
    And, I'm sorry, but my operating system is Chinese, therefore, some Chinese word for content display.

    VS2015 About

    XAML Preview demo video:

  • minzhaominzhao CHMember ✭✭

    Is it so that the MAC connection must exist even for the Android project? That's quite annoying...

  • SarunasKSarunasK LTMember
    edited September 2016

    Note that it seems to require a Mac connection, even to display for Android only.

    could anyone confirm or deny this ?

  • VulcanVulcan TWMember ✭✭✭

    @SarunasK said:

    Note that it seems to require a Mac connection, even to display for Android only.

    could anyone confirm or deny this ?

    On my environment, if I disconnect Xamarin Mac Agent connection, the XAML Previewer will not work

  • SarunasKSarunasK LTMember
    edited September 2016

    when i connect to mac agent i get xaml previewer to load but only for it to crash quickly with grey background and 'XFPageRendererView' text in the center. This feature is so alfa even by Xamarin standards, that they shouldn't have released it yet ...

  • BenKBenK USMember

    @minzhao said:
    Is it so that the MAC connection must exist even for the Android project? That's quite annoying...

    This is a giant oversight. I imagine it must be a bug someone forgot to test for. Giving them the benefit of the doubt I imagine all their dev machines are connected to a remote mac of some type.

    That said, I don't own a Mac I have no intentions of dropping $2k on one so I can preview what is supposed to be a cross platform UI on running on a non-apple platform.

    Xamarin, you're owned by Microsoft now - it's time to start caring about the Visual Studio experience.

  • softlionsoftlion FRBeta ✭✭✭

    @BenK Visual Studio Experience: slow and 1 fix every 6 months. Please dont follow Visual Studio Experience :)

  • softlionsoftlion FRBeta ✭✭✭

    Unexpected exception trying to swap text buffers for the Xamarin.Forms previewer
    System.ArgumentException: Paramètre incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
    at EnvDTE.ProjectItem.get_FileNames(Int16 index)
    at Xamarin.VisualStudio.Forms.Previewer.PreviewerToolWindow.<>c__DisplayClass42_0.b__0(ITextView t) in C:\data\lanes\3822\76037860\source\xamarinvs\src\Features\VisualStudio.Forms.Previewer\PreviewerToolWindow.cs:line 289

  • red49red49 MYMember

    Wait, what? Can anyone from Xamarin actually CONFIRMS that this is not working for Windows?

    Has anyone been able to get the XAML previewer to work in Windows environment?

  • It really need to have connected to a mac to work on VS, I guess this is just a issue and they will solve to the next update.

  • hanglequanhanglequan USMember

    does anyone resolve this problem ?

  • mrlukzmrlukz USMember

    No, I don't think so. It doesn't work for me either. Could anyone give me an issue number in bugzilla? I couldn't find it but I need to be informed when it starts work again :smile:

  • MarkCapleMarkCaple USMember

    Having only seen a blank forms previewer I decided to connect a mac and the 'Forms Previewer' immediately starts to do something. The iOS tab works fine but the Android version just shows a page with XFPageRendererView in its centre. The previewer does say about Design Agent must be running for preview to work and now I believe Design Agent is either running on the Mac or is the Mac connection itself. Have seen a few people mention the XFPPageRendererView so will try to fix that separately but I think for sure you need a Mac. Must be running Xamarin Studio tasks on the mac.

  • MikeeSouthMikeeSouth USMember ✭✭

    I haven't found a solution yet and I've tried all of the things suggested in this thread.

    I have the same problem, i.e. that the Xamarin.Forms Previewer shows a grey background and XFPageRendererView for Android, it does however work for iOS. I can use the iOS version since the previewer is really fast but it would be nice to have the Android preview working as well.

    I'm using Windows 10 Professional, Visual Studio 2015 Enterprise, latest stable Xamarin (4.2.0.695), fully upgraded Android SDK with support for API Level 23, 24 (and some older), latest Android NDK (r12b), a connected Mac Agent running the latest (stable) Xamarin.

    I don't think that the mac agent is necessary for Android preview but I cannot verify it since the Android preview isn't working at all for me.

    If someone have suggestions on how to resolve this for Android preview, I'm happy to try it.

  • AbelDJOUHRIAbelDJOUHRI USMember

    Same problem for me as well, visual studio community 2015, no mac linked and the xaml previewer is not showing anything.

    It's been almost a year that I'm waiting for this feature on VS...

    Any chance to have an answer from Xamarin Team ?

    Thanks,
    Abel

  • KramarKramar USMember

    @MarkCaple said:
    Wooohoooo!!!

    image

    After looking in Xamarin log file I noticed

    ERROR: java.lang.UnsatisfiedLinkError: C:\Program Files (x86)\MSBuild\Xamarin\Android\libmono-android.debug.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform

    So I Installed the 64 bit JDK version from oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

    And changed my Xamarin Options to

    image

    And yippee!!

    This worked for me as well.

    Thanks!!!

    Now if only I can get my visual studio iOS simulator working I would be all set... grumble grumble

  • softlionsoftlion FRBeta ✭✭✭

    You use JDK 7 update 79
    Latest version is JDK 8 update 102. JDK 8 is required since a long time by google components. Uninstall all JDK 7 versions.

    I've updated to JDK8 update 102, still having red screen with XFPageRendereView written in the middle and a yellow bar stating that Telerik.XamarinForms.Input.RadCalendar thew an exception.

  • softlionsoftlion FRBeta ✭✭✭

    I created, built and run succesfully a new default XamForm project. Designer still not working. See attached pics.

  • softlionsoftlion FRBeta ✭✭✭

    I have a crash log !

    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:24.3903] 4 [monodroid] Trying to get property from C:\Users\benja\AppData\Local\Temp\tmp4219.tmp\persist.sys.dalvik.vm.lib
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:24.8375] 4 [monodroid] CREATING NEW CONTEXT
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:25.2015] 5 [monodroid-gc] GREF GC Threshold: 46080
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:25.5494] 5 [monodroid] Calling into managed runtime init
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:25.9324] 4 [monodroid] Created new context with id 1
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:26.3545]
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:26.7711] INFO: Setting id 1 on newly created ClassLoader
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:27.1516]
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:27.4905] INFO: Trying to load class md5e940e1e778de0f856e343395a2f338c5.XFPageRendererView
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:27.8560]
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:28.1849] [Error] MonoDroid: Could not load type 'AndroidFormsRendering.XFPageRendererView, XamarinFormsPreviewer.Android, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Skipping JNI registration of type 'md5e940e1e778de0f856e343395a2f338c5/XFPageRendererView'.
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:28.6466] [Info] MonoDroid: UNHANDLED EXCEPTION:
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:29.0051] [Info] MonoDroid: System.TypeLoadException
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:29.2994] [Info] MonoDroid: at (wrapper managed-to-native) System.Type:internal_from_name (string,bool,bool)
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:29.6077] [Info] MonoDroid: at System.Type.GetType (System.String typeName, System.Boolean throwOnError) [0x00011] in <368820a9888f43ddb85d18e87189adbf>:0
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:29.9827] [Info] MonoDroid: at Java.Interop.TypeManager.n_Activate (System.IntPtr jnienv, System.IntPtr jclass, System.IntPtr typename_ptr, System.IntPtr signature_ptr, System.IntPtr jobject, System.IntPtr parameters_ptr) [0x00082] in <8b383deccbe645ad9a8883f4e65362b4>:0
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:30.5722] mono.android.DesignerException: md5e940e1e778de0f856e343395a2f338c5.XFPageRendererView.n_onMeasure(II)V
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:30.8590] [Info] MonoDroid: at (wrapper dynamic-method) System.Object:b8d2076e-f8aa-47fc-857a-5a9cea34462c (intptr,intptr,intptr,intptr,intptr,intptr)
    Xamarin.VisualStudio.ActivationManager Error: 0 : [2016-10-04 08:36:31.1573] Initial layout loading failed
    Xamarin.AndroidDesigner.Java.JavaErrorMessageException: md5e940e1e778de0f856e343395a2f338c5.XFPageRendererView.n_onMeasure(II)V
    at Xamarin.AndroidDesigner.Java.JavaProcessConnection.d__69.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
    at Xamarin.AndroidDesigner.AndroidRenderSession.d__105.MoveNext()
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:31.7073] at mono.android.DesignerSession.checkRenderResultForError(DesignerSession.java:175)
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:32.0206] ERROR: An exception occured while loading control md5e940e1e778de0f856e343395a2f338c5.XFPageRendererView
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:32.3440] at mono.android.DesignerSession.load(DesignerSession.java:225)
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:32.6914] ERROR: java.lang.reflect.InvocationTargetException
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:33.0609] at mono.android.DesignerSession.processMessage(DesignerSession.java:784)
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:33.6324] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:34.5182] at mono.android.MessageListener.executeMessage(MessageListener.java:88)
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:34.9519] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:35.3404] at mono.android.MessageListener$Runner.run(MessageListener.java:45)
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:35.9335] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-10-04 08:36:36.4278] at java.lang.Thread.run(Thread.java:745)

  • softlionsoftlion FRBeta ✭✭✭
    edited October 2016

    And it works on iOS !!

    It seems that, as soon as there is a rendering exception, you'll always get the exception until you retard VS completely. On my other project the exception is thrown by a Telerik component.

«1
Sign In or Register to comment.