Forms Previewer - 'An exception occurred while rendering the control'

DaveYDaveY USUniversity ✭✭

With Visual Studio 2017 (latest rc) - after opening xaml previewer, I am presented with error in the designer 'an exception occurred while rendering the control'. This occurs while trying to view the Android view. I can however view the ios view when my mac build agent is available.

If I click the (!) icon i see a series of exception messages

i.e.
you must call xamarin.forms.init prior to using it
at xamarin.forms.device.get_info()

etc.

Answers

  • DaveYDaveY USUniversity ✭✭

    Note: this occurs on a brand new xaml forms project (master-detail) based on the template available within the product

  • zjxcrosszjxcross CNMember

    Believe it or not, here is the ultimate (the only) way.

    First, install "Microsoft build tools 2015" from the official website. Then you should download the "Xamarin for visual studio" installer manually (current version is "Xamarin.VisualStudio_4.3.0.784"). Please pay attention, this is very important, you must install the "Xamarin for visual studio" again even though visual studio 2017 already contains it! Finally you should restart visual studio 2017, and the forms previewer will just works fine. I know it is magic, but you should follow the above steps.

    As for me, I start from a clean PC. After installing visual studio 2017, I cannot use the forms previewer anymore. Well everything works fine after I install the "Xamarin for visual studio" manually which has been contained in visual studio 2017.

    By the way, the forms previewer is not mature yet. I cannot use it to preview simple "activity indicator" control and "webview" control in android environment. Although when I use the prism package, I cannot reference the static resource defined in "App.xaml". I used to work with the Gorilla Player, but it doesn't support visual studio 2017. I really hope the Xamarin team can make the forms previewer better for out developers to use.

    Last words: do not forget to set the jdk 1.8 to 64 bit version.
    Have fun with development :-)

  • zjxcrosszjxcross CNMember

    Believe it or not, here is the ultimate (the only) way.

    First, install "Microsoft build tools 2015" from the official website. Then you should download the "Xamarin for visual studio" installer manually (current version is "Xamarin.VisualStudio_4.3.0.784"). Please pay attention, this is very important, you must install the "Xamarin for visual studio" again even though visual studio 2017 already contains it! Finally you should restart visual studio 2017, and the forms previewer will just works fine. I know it is magic, but you should follow the above steps.

    As for me, I start from a clean PC. After installing visual studio 2017, I cannot use the forms previewer anymore. Well everything works fine after I install the "Xamarin for visual studio" manually which has been contained in visual studio 2017.

    By the way, the forms previewer is not mature yet. I cannot use it to preview simple "activity indicator" control and "webview" control in android environment. Although when I use the prism package, I cannot reference the static resource defined in "App.xaml". I used to work with the Gorilla Player, but it doesn't support visual studio 2017. I really hope the Xamarin team can make the forms previewer better for out developers to use.

    Last words: do not forget to set the jdk 1.8 to 64 bit version.
    Have fun with development :-)

  • XamITXamIT USMember ✭✭

    Hi zjxcross,

    I am facing lots of errors including the one reported above by DaveY.
    Apparently, there is no download available for Microsoft Build tools 2015.
    Installation of Xamarin for VisualStudio is not available as well.

    Any pointers that I should be looking for to fix this issue?

    Thank you very much

  • pagaltierpagaltier Member
    edited February 2018

    Microsoft Build tools 2015: www.microsoft.com/en-us/download/details.aspx?id=48159 (use https in front of the url)
    Xamarin for visual studio: dl.xamarin.com/XamarinforVisualStudio/Windows/Xamarin.VisualStudio_4.5.0.476.msi (use http in front of the url)

    (Sorry for the formatting but as I'm a rookie on this forum I cannot post url :()

  • dinobdinob USUniversity ✭✭✭

    @ClintStLaurent said:
    @DaveY

    There are countless threads about Previewer.

    It doesn't work. That's the bottom line.

    it is a piece of shit, that is what it is

  • dinobdinob USUniversity ✭✭✭

    I wonder how many more times they will close request to fix this in forums with comment "Closing, if it is still occurring, create new request". Why dont you remove it entirely if it does not work at all.
    I just created bare ContentView XAML page, nothing in it, still doesn't work!

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    @dinob
    Previewer is an abandoned technology. No point trying to use it.
    Take a look at LiveReload. Its still in preview stage and already 10 times better than any previous product they had going for this niche. Its pretty darn cool to just hit save in visual studio and watch your iPad, Android phone and UWP window all update at the same time. Real time saver there.

  • NMackayNMackay GBInsider, University mod

    @dinob
    Previewer is an abandoned technology. No point trying to use it.
    Take a look at LiveReload. Its still in preview stage and already 10 times better than any previous product they had going for this niche. Its pretty darn cool to just hit save in visual studio and watch your iPad, Android phone and UWP window all update at the same time. Real time saver there.

    LiveReload has the advantage of been able to work with MVVM frameworks like Prism which use constructor injection, also it should work with third party controls like RadControls.

    I don't know why the didn't make the author of LIveXAML an offer, MS were happy to blow 18 million on LinkedIn, lets not mention Nokia, Xamarin was a bargain acquisition in comparison. They have persisted with different projects, I just hope they persist with LiveReload only. As @ClintStLaurent says, it's abandoned, it was made to give some wow factor at Evolve 2016, I was there and fell for that particular Jedi mindtrick :)

  • dinobdinob USUniversity ✭✭✭

    @ClintStLaurent said:
    @dinob
    Previewer is an abandoned technology. No point trying to use it.
    Take a look at LiveReload. Its still in preview stage and already 10 times better than any previous product they had going for this niche. Its pretty darn cool to just hit save in visual studio and watch your iPad, Android phone and UWP window all update at the same time. Real time saver there.

    I can see that, 3 years later, still in both VS and VS4Mac yet abandoned.

    LiveReload is only for Windows btw but thanks for sharing

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    @dinob said:
    LiveReload is only for Windows btw but thanks for sharing

    Nope. Works with your Android and iOS devices as well.

  • NMackayNMackay GBInsider, University mod
    edited October 2018

    @ClintStLaurent said:

    @dinob said:
    LiveReload is only for Windows btw but thanks for sharing

    Nope. Works with your Android and iOS devices as well.

    Guessing he/she means Windows 10. Got toothache so can't think clearly

  • dinobdinob USUniversity ✭✭✭
    > @ClintStLaurent said:
    > @dinob said:
    > LiveReload is only for Windows btw but thanks for sharing
    >
    >
    >
    >
    >
    > Nope. Works with your Android and iOS devices as well.

    I mean, you need to download and install it, the download is currently available only for Windows, no Mac download is available
  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    Oh... You're talking about Visual Studio for Windows? You're saying its not supported on Visual Studio for Mac? So you mean the IDE you're using, not the device you're targeting. Is that right?

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    Let me be clear when I say this... I love mac. I've had them for decades from an original 9" black&White screen, my own XServe and XRaid, Apple phones and iPads...

    However Visual Studio for mac is a toy. This is just one of dozens of deficiencies. You can't really expect to use it for professional development in its current state.

    Install VMware Fusion on your mac, then install Visual Studio for Windows.
    or
    Use Bootcamp and boot direct to Windows. when you are doing development and go back to mac at the end of the day and you're off the clock doing personal work. Two environments for different aspects of life is a clean delineation.

  • GiampaoloGabbaGiampaoloGabba USMember ✭✭✭

    Yes liveReload is good but the development is so slow... I fear this will be the next abandoned / half-assed project from Xamarin :(

    The last updated occoured more than 5 months ago....

    On the other hand LiveXaml works better, support more platforms, UI in c#...

    I just cant understand why Xamarin spent time in things like Forms Previewer or Live Player... such a waste of time!

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    @GiampaoloGabba said:
    Yes liveReload is good but the development is so slow... I fear this will be the next abandoned / half-assed project from Xamarin :(

    The last updated occoured more than 5 months ago....

    Yeah... that has me worried as well. There was such hope when preview version 4 was accidentally made publicly viewable about 3 months ago. You couldn't download it, but you could see it in the version list for about a week. Yet... here we still are with no updates. For a company that is pushing the concept of "DevOps" and "Continuous Integration" where a key concept is lots of smaller updates going out regularly as opposed to 2 big updates per year - they don't seem to practicing what they preach.

    CC: @DavidOrtinau @JGoldberger
    Hi Guys. Any chance you have some insider information to share about LiveReload? Is it still being worked on?

  • NMackayNMackay GBInsider, University mod

    @JamesMontemagno

    Copying in James as I think he mentioned on twitter he was keen to see this aspect of the toolset improved.

  • GiampaoloGabbaGiampaoloGabba USMember ✭✭✭

    @ClintStLaurent said:
    Yeah... that has me worried as well. There was such hope when preview version 4 was accidentally made publicly viewable about 3 months ago. You couldn't download it, but you could see it in the version list for about a week. Yet... here we still are with no updates. For a company that is pushing the concept of "DevOps" and "Continuous Integration" where a key concept is lots of smaller updates going out regularly as opposed to 2 big updates per year - they don't seem to practicing what they preach.

    Et voilà, things went exactly as I thought :)
    https://github.com/xamarin/Xamarin.Forms/issues/4155#issuecomment-431596130

    The most useful tool has been discontinued and pulled off from the extension catalog :(

    I think they want to go all in with the previewer (though i doubt it will ever work with DI, custom renderers, effects, complex screens, realtime data, ecc...) and leave the hot reload to third parties developers.
    I'm fine with this as long as product like LiveXaml exists... But i just dont understand this decision.

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    PreviewER? Is this different than the last crappy "preview" tool they had?
    LiveReload is awesome - the ability to hit save and watch 3 different platform devices all update at the same time!

    CC: @DavidOrtinau @JGoldberger @JamesMontemagno
    Can someone shed some light on this? Yet another XAML preview tool dieing in the crib? None of them seem to get past the first 6 months of development. LiveReload really showed the most promise. Why not make it work rather than start (and probably abandon) yet another preview tech?

  • NMackayNMackay GBInsider, University mod

    @ClintStLaurent said:
    PreviewER? Is this different than the last crappy "preview" tool they had?
    LiveReload is awesome - the ability to hit save and watch 3 different platform devices all update at the same time!

    CC: @DavidOrtinau @JGoldberger @JamesMontemagno
    Can someone shed some light on this? Yet another XAML preview tool dieing in the crib? None of them seem to get past the first 6 months of development. LiveReload really showed the most promise. Why not make it work rather than start (and probably abandon) yet another preview tech?

    Livereload has been officially canned btw in favour of persisting with the Forms previewer....

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    @NMackay

    THAT SUCKS!

    No other way to put it.

    Mostly because the previewer is gawd-aweful, limited, horrible and broked in so many ways.

    WTF Sorry I'm not longer allowed to use those letters here. What the heck are they doing and thinking? Let's can the technology that is working and push the tech that doesn't? I'm at a total loss for grasping the thinking going on.

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    @NMackay said:
    The 15.9 previewer should support Prism for example but they need to be much more upfront about what their plans are.

    Let be clear, the community did not want this, I think we've made out feeling clear on this via different channels.

    I'm surprised at myself for feeling so down about this. Usually I'm better at being more of a "roll with the punches" kinda guy. But I feel like I'm tired of getting punched. I'm the person that convinced my copy to go with Xamarin for the new line of products. I'm the guy that started using LiveReload then got the rest of the team on board with it-And they love it. It was just bragged up big at Build 2018. Now its dead out of the blue. Parts of Xamarin that have been reported as problematic for years, literally years, are still getting no attention.

    Let be clear, the community did not want this, I think we've made out feeling clear on this via different channels.

    Well nobody wanted CSS either - and were clear about that - but it doen't matter.

    I guess I'm just feeling almost like this is that straw that broke the camel's back. Its not a matter of it being just the one thing they've abandoned and wasted... what... 5 man-years of labor on (10 people for 6 months?)... Its not the one tech... its that it is yet another instance. One after another. They show off something cool at a trade show, whether it is remote USB at Xamarin 2016, or LiveReload at Build 2018... they get people to sign on and buy in... get the bump in numbers so they can sell... whatever it is (Azure subscriptions?)... then kill the thing they just bragged up.

    I feel like an idiot. I feel like I've been duped into jumping on this whole Xamarin train. I've been a mouthy s.o.b. but mostly about saying how great Xamarin is, or could be, or has the potential to be. Heck people don't pay for sites and invest their time into making tutorial sites like I have (and many other people have) if they don't believe in something. Now I'm pretty much married to this platform because I was STUPID ENOUGH to bring my company on board with it. We're in it now. And for the first time since getting into Xamarin, I wish we weren't.

    I feel like they are making work trucks without listening to the people using them for work. Filling them with latte dispensers, and free cartoon network subscriptions but lacking the actual ability to do work. Total detachment from the customer base they are developing for.

    So congrats Microsoft and Xamarin. You just lost the hearts and minds of at least one ardent supporter. Not over one thing. But over a continued and repeated pattern of not caring for the wishes of the developers. When you're making developer tools, you kinda should care about what the developers want.

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    The really sad part of all this, is I had just gotten a p.m. from someone expressing their appreciation for my help and my tutorial site. I was all jazzed up and thinking about how I might find more time to write tutorials since I get a letter like this often enough to make me realize they are helping folks. Now I just want to back out of this entirely.

  • NMackayNMackay GBInsider, University mod
    edited October 2018

    It could be easily fixed, they could have made this product owner a decent offer....they wasted 18 billion buying LinkedIn....

    https://www.livexaml.com/

    Why not give Pro/Enterprise customer a livexaml licence, just an idea.

    I separate this from Forms/Mono/Xamarin. Forms is improving very nicely, it's just the tooling sucks. VS2017 15.8 has been horrible, I hate using it.

    Maybe 15.9 will be a step in the right direction. This smacks of internal politics at Microsoft, seen it before.

  • JohnHJohnH GBMember ✭✭✭✭✭

    @NMackay said:

    Any idea on the timeline for 15.9?
    I agree 100% on 15.8, only the last 2 versions of that have been close to a 'stable' release.

    Fingers crossed they intend to take the tech they developed in Livereload and use it in the previewer itself.

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    @NMackay said:
    It could be easily fixed, they could have made this product owner a decent offer....they wasted 18 billion buying LinkedIn....

    https://www.livexaml.com/

    Would be nice if this ran on a real device and not emulator. Its funny how one side of the house is all about emulator tools - then the other side is about how emulators are not accurate and if you want any real clue whats going on you have develop with a physical device. I've seen so many times when emulators just didn't work, especially where custom drawing is concerned; which including mapping apps.

    Why not give Pro/Enterprise customer a livexaml licence, just an idea.

    We're sure paying enough for it. I can't even fathom what our MSDN subscription costs for multiple developers in various states.

  • NMackayNMackay GBInsider, University mod
    edited October 2018

    @JohnHair said:

    @NMackay said:

    Any idea on the timeline for 15.9?
    I agree 100% on 15.8, only the last 2 versions of that have been close to a 'stable' release.

    Fingers crossed they intend to take the tech they developed in Livereload and use it in the previewer itself.

    The Visual Studio product manager mentioned "months" a few weeks ago on twitter. Here's the roadmap.

    https://docs.microsoft.com/en-us/visualstudio/productinfo/vs-roadmap

  • NMackayNMackay GBInsider, University mod

    Adding this github thread to the discussion, if you think it's crap LiveReload was axed without asking then mention it on this thread

    https://github.com/xamarin/Xamarin.Forms/issues/4155#issuecomment-431972619

  • dinobdinob USUniversity ✭✭✭

    Neither of these works
    Preview (in Xamarin/VS studio)
    Previewer
    LiveReload
    XamarinLive Player

  • JohnHughesJohnHughes USMember ✭✭

    So, since I am using the latest verision and the live previewer still does not work, I am guessing they won't fix it after reading this thread.

  • XandManXandMan USMember ✭✭

    So 'on my machine' ;) the Android Forms Previewer works considerably better (although not perfectly) in Visual Studio 2019, and also gives the option to change the Android device emulator type.
    pic 1 Capture_VS_2019_Android_Previewer_01
    pic 2 Capture_VS_2019_Android_Previewer_02

    There is a down side. It requires projects to upgrade the Xamarin.Forms Nuget package to the latest version ( currently 3.6) and that can provide to some breaking changes and/or extra re-architecting of older projects.
    But for new projects, its a gem.

    Another downside to VS2019 is that its NOT compatible with older MacBooks, running XCode 10.1
    (or be it, the last version of XCode & OSX my old MacBook can update to.)
    pic 3 Capture_VS_2019_Android_Previewer_03
    pic 3b Capture_VS_2019_Android_Previewer_03b

    Conclusion; VS2019 is better with the Android Forms Previewer, but NOT with the iOS development and XCode 10.1 (or below)
    But my VS2017 works just fine (for now) with the iOS forms previewer, but the Android Previewer fails.
    pic 04 Capture_VS_2019_Android_Previewer_04
    pic 04b Capture_VS_2019_Android_Previewer_04b

    Now if MS could make VS2019 compatible with XCode 10.1 I would be a happy camper, instead of jumping back-n-forth between IDEs.

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    Great bit of comparison. Really appreciate that effort.

    What I've seen, even in VS2019 is that as soon as you make use of app-scoped styles... resource dictionaries... custom renderers... custom controls... derived controls (inheritence from ContentPage or ContentView) then Previewer is sunk.

    Sadly those are all things you have in a "grown up" app. Anything you make that it is capable of handling probably isn't something that falls into the "professional-grade" category.

    Its one of those situations where the more you need the tool because the app has grown from being a little proof-of-concept or practice program, the less likely the tool is going to be able to help you.

Sign In or Register to comment.