问题描述
我正在使用多种测试设备进行开发-Nexus 5和Nexus S.
I'm using multiple test devices for development - Nexus 5 and Nexus S.
Nexus 5没有任何问题,但S one似乎有问题.
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();
};
}
此代码在Nexus S上中断,该设备发现按钮为空.因此,我假设它无法正确或快速地生成我的布局.
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.
我尝试添加一个简单的null检查,但是应用程序似乎完全忽略了它,并使用了旧的程序集.因此,看起来在旧设备上,程序集在部署时不会自动替换.
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?
Nexus S的API级别为API 16
The API level of the Nexus S is API 16
通过Visual Studio启动它,取消选中部署"配置设置,因此我认为这是不刷新的原因. Xamarin中是否有某个设置可以在某个时候自动将其重置?
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?
推荐答案
尝试从设备上手动卸载应用程序,然后再次对其进行调试/部署.
Try uninstalling the application manually from the device and debugging/deploying it again.
这篇关于Xamarin.Android重新部署应用程序不会更新程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!