Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin.Android re-deploying the application does not update the assembly

I'm using multiple test devices for development - Nexus 5 and Nexus S.

Didn't have any problem with the Nexus 5, but the S one seems to be having a problem.

protected override void OnCreate (Bundle bundle)
        {
            base.OnCreate (bundle);

            SetContentView (Resource.Layout.Main);

            Button button = FindViewById<Button> (Resource.Id.myButton);
            button.Click += delegate
                {
                    Authenticate();
                };
        }

This code breaks on the Nexus S, which finds the button to be null. Thus I'm assuming it's not generating my layout properly or quickly enough.

I have tried adding a simple null check, but the application appears to be completely ignoring it and using the old assembly. Thus it looks like on an older device the assemblies are not auto-replaced when you're deploying.

Has anyone experienced this? What would be the fix?

EDIT: The API level of the Nexus S is API 16

EDIT: Launched it via Visual Studio, "Deploy" configuration setting was ticked off, so I assume that was the cause of it not refreshing. Is there a setting in Xamarin that automatically resets it at some point?

like image 841
EvilBeer Avatar asked Oct 20 '22 23:10

EvilBeer


1 Answers

Try uninstalling the application manually from the device and debugging/deploying it again.

like image 80
Narcís Calvet Avatar answered Oct 28 '22 21:10

Narcís Calvet