1

I have a pretty straightforward page that has a few controls on it. My problem only occurs on an actual device and only occurs on my Lumia 1520 running Win10 Mobile version 1607 Build 10.0.14946.1000. It does not happen on my Lumia 950 running Win10 Mobile version 1607 OS Build 10.0.14393.693.

On the 1520 I un-install my app, reboot the device and then attempt to debug the app on the device. Everything works fine. I then stop debugging and attempt to start debugging again and the InitializeComponent method of my page does not initialized any of my controls.

What that means is that after this code runs:

    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Forms.Build.Tasks.XamlG", "0.0.0.0")]
    private void InitializeComponent() {
        this.LoadFromXaml(typeof(nearbyplaces));
        pgHeader = this.FindByName<global::GBarScene.pageheader>("pgHeader");
        lblPlacesTitle = this.FindByName<global::Xamarin.Forms.Label>("lblPlacesTitle");
        btnMapAll = this.FindByName<global::Xamarin.Forms.Label>("btnMapAll");
        lblDataSource  = this.FindByName<global::Xamarin.Forms.Label>("lblDataSource ");
        btnUseGPS = this.FindByName<global::Xamarin.Forms.Image>("btnUseGPS");
        lblRatingsFor = this.FindByName<global::Xamarin.Forms.Label>("lblRatingsFor");
        lblDowName = this.FindByName<global::Xamarin.Forms.Label>("lblDowName");
        bvUnderline = this.FindByName<global::Xamarin.Forms.BoxView>("bvUnderline");
        lvPlaces = this.FindByName<global::Xamarin.Forms.ListView>("lvPlaces");
    }

Every control (psHeader, lvPlaces etc.) are all still null. (If I attempt to launch the app on the 1520 without debugging after running it the first time, it crashes)

I see nothing in the output window indicates there was a challenge in other areas. Any idea why this is happening?

UPDATE UPDATE: So I reset the device (I got the same build etc) and tried testing again. I am now getting some error information. Below are the steps to reproduce the error as well as the error information:

  1. Un-install any previous version of the app from the Device.
  2. Restart the device
  3. Test the app on the device. (It should work fine.)
  4. Click the Stop button in the Visual Studio 2015 environment
  5. At this point simply click the Run button in Visual Studio without making changes in the App, it will launch fine on the phone.
  6. Click the Stop button in the Visual Studio 2015 environment
  7. Make a change in the main page of the application and recompile. Ensure the Build line shows at least 1 project succeeded and not just all up to date or skipped.

    2 succeeded, 0 failed, 0 up-to-date, 2 skipped ==========

    1. Run the application on the Device again.

An error is generated at the LoadApplication line shown below:

public sealed partial class MainPage
{
    public MainPage()
    {
        this.InitializeComponent();

        this.NavigationCacheMode = NavigationCacheMode.Required;

        LoadApplication(new GBarScene.App());

Below is the error information: An exception of type 'System.ArgumentNullException' occurred in Xamarin.Forms.Platform.WinRT.ni.DLL but was not handled in user code.

I click on the View Details and I see the following information: "Value cannot be null.\r\nParameter name: newRoot"}

I hope this helps in getting this problem resolved.

UPDATE: The problem also happens on my Lumia 640 XL that was upgraded to Win 10 Mobile.

George M Ceaser Jr
  • 1,497
  • 3
  • 23
  • 52
  • I don't have the windows phone of version 14946, but I tested it a blank app with a few labels and Buttons and it works well. Could you please try update your windows phone's system to 15007 see if the problem persists? – Elvis Xia - MSFT Feb 01 '17 at 05:37
  • I an on the fast track for the Windows Insider program and there is no update available to take me to 15007. This phone was updated from Windows Phone 8.1 also just so you know. – George M Ceaser Jr Feb 01 '17 at 14:06
  • Did you find a solution to this problem? I struggling with something vert similar. Thanks. – raver99 Feb 05 '18 at 03:59
  • This is very old. If you are having the challenge I would recommend you ensure you are running the latest version of all the Xamarin stuff. – George M Ceaser Jr Feb 07 '18 at 00:14

0 Answers0