Reputation: 11
I am pretty new to xamarin , Just tried to implement Hello world on button click . In my .axml file i created button and in .cs file i have written logic to say hello world on button click. when i try to run the application by selecting the android emulator from the provided list of emulators, first application says deploying after that it is going to debug mode though i didn't give any break point, from debug mode it is launching the emulator and program goes out of execution . when i checked the apps in emulator i cant see my application in that . I tried a solution in the forum which says to start the emulator again while it's running but this time i can see my application opening up but with in seconds it says "unfortunately application is closed". Tried to uncheck the fast deploying option but no use. Can any one help me in this .
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle);
// Set our view from the "main" layout resource
// SetContentView (Resource.Layout.Main);
Button myButton = FindViewById<Button>(Resource.Id.btnHw);
myButton.Click += myButton_Clcik;
}
void myButton_Clcik(object sender, EventArgs e)
{
Toast.MakeText(this, "Hello world", ToastLength.Long).Show();
}
}
Thank you.
Upvotes: 0
Views: 2222
Reputation: 944
Its because the missing libaot-mscorlib.dll. so, which is usually hidden in a plethora of messages - is easy to fix: disable Android fast deployment. Go to the properties of the Android project, hit tab “Android options”, and unselect “Use Fast Deployment”.
If this doesnot work, do these following steps:
Read the article, i guess it will help https://dzone.com/articles/fix-for-could-not-connect-to-the-debugger-while-de
Upvotes: 0