This project has moved and is read-only. For the latest updates, please go here.

Have anybody faced an issue, while using mvvm light that the app is crashing in release mode only?

Feb 22, 2016 at 11:33 AM
I am new in Xamarin, while trying to build an app in Xamarin android using MVVM light, the app is running absolutely fine in debug mode, but in release mode it is abruptly crashing, after getting successfully deployed in the device. No error message is getting logged in the Xamarin studio, only two exceptions are shown, which are same.
Exception : C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(3,3): Warning MSB3247: Found conflicts between different versions of the same dependent assembly. In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts; otherwise, add the following binding redirects to the "runtime" node in the application configuration file: (MSB3247) (AppMvvm)
Feb 22, 2016 at 11:33 AM
Hey, I isolated the problem, the page is crashing only when I am binding an edit text box in release mode, but binding a text view with the view model is working fine.
` [Activity (Label = "AppMvvm", MainLauncher = true, Icon = "@mipmap/icon")]
public class MainActivity : Activity
private static bool _isInitialized;
public MainViewModel ViewModel { get; set; }
int count = 1;
public Button button;
public EditText userNameData,userNameData1;
public TextView userNameDisplay,userNameDisplay1;

protected override void OnCreate (Bundle savedInstanceState)
    base.OnCreate (savedInstanceState);

        var nav = new NavigationService();
        nav.Configure(ViewsList.Main.ToString(), typeof(MainActivity));
        var builder = new ContainerBuilder();
        var container = builder.Build();
        var serviceLocator = new AutofacServiceLocator(container);
        ServiceLocator.SetLocatorProvider(() => serviceLocator);
        _isInitialized = true;

    ViewModel = ServiceLocator.Current.GetInstance<MainViewModel>();
    //ViewModel.UserName = "TEST";
    ViewModel.New = "Bind";
// ViewModel.New=ViewModel.UserName;
    SetContentView (Resource.Layout.Main);

    userNameData = FindViewById<EditText> (Resource.Id.textBoxName);

    userNameDisplay1= FindViewById<TextView> (Resource.Id.textName1);
    userNameDisplay= FindViewById<TextView> (Resource.Id.textName);
    userNameData1 = FindViewById<EditText> (Resource.Id.textBoxName1);
    this.SetBinding(() => ViewModel.UserName, userNameData, () => userNameData1.Text,BindingMode.TwoWay);

    this.SetBinding(() => ViewModel.UserName,userNameData1, () => userNameData1.Text, BindingMode.TwoWay);
// button = FindViewById (Resource.Id.myButton);
// button.Click += delegate {
// button.Text = string.Format ("{0} clicks!", count++);
// //ViewModel.UserName = string.Format ("{0} clicks!", count++);
// var test = FindViewById (Resource.Id.textBoxName);
// //this.SetBinding(() => ViewModel.UserName, userNameDisplay1,() => userNameData.Text, BindingMode.TwoWay);
// this.SetBinding(() => ViewModel.UserName, userNameData,() => userNameData1.Text, BindingMode.TwoWay);
// }`