My application has always been deploying fine to my phone using the Live Player tool, I was testing fine even as recently as an hour or two ago. However, suddenly it has stopped deploying. It goes through the usual process and says "Deploy to Samsung SM-J500FN Player succeeded" in Visual Studio, and in the Live Player on my phone it says "Connected to Visual Studio", but the app does not appear. I've not changed any of the settings, all I've done since it last worked is follow this link to add a customer renderer to my project.
https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/custom-renderer/entry
Has anyone else experienced this, or have any suggestions? I've tried cleaning and rebuilding, as well as rebuilding each project one-by-one, but still the same issue was occurring.
UPDATE:
Upon further investigation, it appears that it was because in my xaml code, adding a custom entry was causing the issue, as it couldn't add it to the designer.
This is the problematic code:
<local:MyEntry x:Name="txtFirstName" Placeholder="First Name" Keyboard="Text" TextColor="DarkBlue" PlaceholderColor="DarkBlue" Completed="NameCompleted" HorizontalOptions="Start" WidthRequest="300" Text="{Binding FirstName, Mode=TwoWay}" />
Am I not supposed to set the properties of a custom entry control in xaml?
If that is the case, I need 2 custom entry controls, both with a couple of different properties to the other, so would I need 2 custom renderers for this, or am I misunderstanding how to set the properties of a custom renderer?
To be honest I have not worked with Live Reload yet. It is a preview product so some glitches are to be expected.
That said, if you have not had luck working with emulators before there is no reason to expect it to work with Live Reload. If you normally test on device, you should be able to do that, just select your physical device from the device dropdown.
Please go over the docs carefully, especially the troubleshooting section. In those docs it does say that it will connect to localhost: when deploying to an emulator, so that should not be the issue. To deploy to a device, the device does have to be on the same WiFi network as your PC.
Answers
@DavidH_1997
This is because custom renderers are not support in Xamarin Live Player. See: https://docs.microsoft.com/en-us/xamarin/tools/live-player/limitations?tabs=ios#limitations
Xamarin.Forms
You might want to use Xamarin Live Reload instead if you are using VS Windows (not available for VS for Mac yet):
https://docs.microsoft.com/en-us/xamarin/xamarin-forms/xaml/live-reload
I've installed LiveReload and included the below code in my MainPage.xaml.cs file of the .NET Shared Project.
But LiveReload isn't running? Have I done something wrong? How do I run it?
@JGoldberger when I deploy or build the project, it's opening in the built-in Android emulator, which has never worked for me for some reason, so I'm not sure how to run the Live Reloader? It says at the top it's connected to localhost: and a port number, but I can't actually see it or work out how to run it
@DavidH_1997
To be honest I have not worked with Live Reload yet. It is a preview product so some glitches are to be expected.
That said, if you have not had luck working with emulators before there is no reason to expect it to work with Live Reload. If you normally test on device, you should be able to do that, just select your physical device from the device dropdown.
Please go over the docs carefully, especially the troubleshooting section. In those docs it does say that it will connect to localhost: when deploying to an emulator, so that should not be the issue. To deploy to a device, the device does have to be on the same WiFi network as your PC.