Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i enable debug in android project properties (Xamarin Android)

I am developing an app in Xamarin Android and I keep getting this warning in Visual Studio:

Android Application is running (debug is disabled in android project properties)

View Image

How can i enable debug in android project properties?? I have added in AssemblyInfo.cs the following code as mentioned somewhere.

#if DEBUG
[assembly: Application(Debuggable = true)]
#else
[assembly: Application(Debuggable=false)]
#endif

But nothing changes and no breakpoints are being hit.

like image 698
Georgia Kalyva Avatar asked Dec 17 '15 14:12

Georgia Kalyva


People also ask

What is debug app in Android Studio?

The debugger is an essential tool that lets you inspect the execution of the code that powers your Android app so that you can fix any bugs in it. It lets you specify points at which to suspend the execution of the code and manually interact with variables, methods, and other aspects of the code.


3 Answers

I had to turn Optimize Code option OFF which I had turned ON by mistake I think. After that delete bin and obj folders and rebuilding did the work.

like image 161
Morse Avatar answered Sep 27 '22 21:09

Morse


In my case -> build -> Configuration Manager -> change de relea

like image 45
Jhon Alexander Jimenez Morales Avatar answered Sep 27 '22 20:09

Jhon Alexander Jimenez Morales


There are a few things you need to look at.

1) One way to double check that it is at the project level would be looking at the csproj file for the project using notepad++ or some other text editor and looking at the debugtype, debugger, debug symbols for the property group Debug|X

enter image description here

2) Make sure the setting inside the project properties that enable developer instrumentation is checked.. may be a little different in Xamarin Studio or an iOS project

enter image description here

3) If those simple properties are all set properly you may have a bigger issue related to mbd files not getting properly updated. Some people have had success clearing their debug folder and obj folders within the project so that the mbd files get rebuilt.

https://forums.xamarin.com/discussion/40832/breakpoints-not-being-hit-for-android-and-xamarin-forms

like image 35
ClintL Avatar answered Sep 27 '22 21:09

ClintL