简体   繁体   English

Xamarin.Android 重新部署应用程序不更新程序集

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

I'm using multiple test devices for development - Nexus 5 and Nexus S.我正在使用多个测试设备进行开发 - Nexus 5 和 Nexus S。

Didn't have any problem with the Nexus 5, but the S one seems to be having a problem. Nexus 5 没有任何问题,但 S 似乎有问题。

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.此代码在 Nexus S 上中断,发现按钮为 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.我尝试添加一个简单的 null 检查,但应用程序似乎完全忽略它并使用旧程序集。 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编辑:Nexus S 的 API 级别是 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.编辑:通过 Visual Studio 启动它,“部署”配置设置被勾选,所以我认为这是它不刷新的原因。 Is there a setting in Xamarin that automatically resets it at some point? Xamarin 中是否有一个设置会在某个时候自动重置它?

尝试从设备手动卸载应用程序并再次调试/部署它。

Do a build clean, then manually delete all obj/bin folders, then build and redeploy to the device.进行构建清理,然后手动删除所有 obj/bin 文件夹,然后构建并重新部署到设备。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM