Bug 39122 - Breakpoints not Hit in primary Android project
Summary: Breakpoints not Hit in primary Android project
Status: VERIFIED NOT_REPRODUCIBLE
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Debugger ()
Version: 4.0.0 (C6)
Hardware: PC Windows
: Normal normal
Target Milestone: 15.4
Assignee: Joaquin Jares
URL:
Depends on:
Blocks:
 
Reported: 2016-02-25 14:08 UTC by Matt Wilhelm
Modified: 2017-09-29 10:48 UTC (History)
7 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED NOT_REPRODUCIBLE

Description Matt Wilhelm 2016-02-25 14:08:33 UTC
Filing this bug based on support Ticket #283236 

Basically, my breakpoints stopped being resolved in my Android Project, but they work in referenced projects, PCL's etc. 

Env Info:
Xamarin 4.0.1.96 (dcea9c1)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android 6.0.1.10 (e98e962)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS 9.4.1.24 (47eb74b)
Visual Studio extension to enable development for Xamarin.iOS.



I've tried cleaning/rebuilding and various combinations of checking & unchecking android configuration options (link assemblies, enable/disable instrumentation, shared runtime, etc.)

I made no changes to my .csproj file and in fact have since rolled back to a point I know was working (1 month ago) - but the problem persists. 
I have periods (.) but no spaces ( ) or any other special characters (no @ signs) in my folder paths.
I have 2 PCL's, 2 binding projects, and a couple of submodules. I can hit break points in my PCL's and subprojects, just not the main project.

Issue does not exist in Xamarin Studio on the Mac.

Here's my basic test case:
Submodule 1 implements Android.App.Application & overrides onCreate.

 e.g. public class Submodule1App : Application

Main Project inherits Submodule1App and overrides OnCreate, 

e.g. MainApp : Submodule1App

1.) Set a break in MainApp at base.OnCreate().

2.) Set a break in Submodule1App at base.OnCreate()

Expected: MainApp breakpoint hits before Submodule1App breakpoint
Actual: MainApp never hits breakpoint, but Submodule1App does.


Rolling back to the previous stable release fixed this issue:

Xamarin   4.0.0.1717 (1390b70)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   6.0.0.35 (d300845)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   9.3.99.33 (ea30b32)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 1 Matt Wilhelm 2016-02-25 14:10:45 UTC
Forgot to include VS version info:

Microsoft Visual Studio Enterprise 2015
Version 14.0.24720.00 Update 1
Microsoft .NET Framework
Version 4.6.01038
Comment 2 Jose Gallardo 2016-02-25 14:16:18 UTC
Hi Matt,

As per shared version info you're not seeing this issue on latest stable, and you're still using 4.0.0 bits.
Can you please confirm if updating to 4.0.1 helps? Our current stable build is 4.0.1.96.

Thanks!
Comment 3 Matt Wilhelm 2016-02-25 14:19:46 UTC
Hi Jose,

I upgraded to:

Xamarin 4.0.1.96 (dcea9c1)

and ran into the problem.  when I downgraded to:

Xamarin   4.0.0.1717 (1390b70)

the breakpoints are working again.

While I was on 4.0.1.96; I also ran the gamut of other suggestions online, including - none of which worked for me:

https://forums.xamarin.com/discussion/37836/xamarin-debugger-not-hitting-the-breakpoints/p4
https://forums.xamarin.com/discussion/3770/breakpoints-not-hitting-using-visual-studio
https://forums.xamarin.com/discussion/41714/breakpoints-not-hitting
https://stackoverflow.com/questions/30641160/why-cant-i-hit-the-breakpoint-when-i-start-debug-the-xamarin-android-applicatio
https://bugzilla.xamarin.com/show_bug.cgi?id=29628
https://bugzilla.xamarin.com/show_bug.cgi?id=28781
Comment 4 Matt Wilhelm 2016-02-25 23:12:44 UTC
As a side note, I just had this issue crop up in my current configuration.

Xamarin   4.0.0.1717 (1390b70)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   6.0.0.35 (d300845)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   9.3.99.33 (ea30b32)
Visual Studio extension to enable development for Xamarin.iOS.


It was working fine all day then just stopped.  The only thing I can think of is that I stopped a few builds in the middle of compilation.  One was stuck processing string resource files, so I did a clean and a rebuild, then I lost connection to my Mac in the middle of the build so I reboot both the Mac and the PC.

I'm not sure if that was what broke it or not, but I will try to do an uninstall/reinstall and see if I can reproduce the issue.
Comment 5 Joaquin Jares 2016-02-29 18:51:51 UTC
Matt, can you provide debug logs (that's Debug -> Windows -> Output)? The case looks fairly normal to me, so this should not be happening at all. Maybe there's an error in the logs that will help me understand.
Comment 6 Matt Wilhelm 2016-05-03 17:05:23 UTC
Joaquin, I have an example for you that is not for a client.  Nevertheless, I would still prefer to share the debug logs privately.  Bugzilla is not letting me mark it as private.  Can I email them?

Basically, my case still exists:

1.) set a breakpoint anywhere in a TOP-LEVEL android app
2.) set a breakpoint anywhere in either a PCL or an android Library project downstream from the the first.

Expected: The TOP-LEVEL breakpoint is hit
Actual: only the downstream breakpoint is hit.

Note that this is a new project and I was able to hit breakpoints when i first started but after normal usage it stopped after a few deploys.  I.e. Deploy 1 breakpoints hit, deploy 3 breakpoints stop working and not amount of cleans/rebuilds/delete bi and obj do anything.

here's some updated env info:

Microsoft Visual Studio Enterprise 2015
Version 14.0.25123.00 Update 2
Microsoft .NET Framework
Version 4.6.01038

NuGet Package Manager   3.4.2

Visual Studio Tools for Universal Windows Apps   14.0.25208.00


Xamarin   4.0.3.214 (0dd817c)
Xamarin.Android   6.0.3.5 (a94a03b)
Xamarin.iOS   9.6.1.8 (3a25bf1)
Comment 7 Joaquin Jares 2017-01-19 14:44:39 UTC
I'll try a repro and confirm.
Comment 8 Joaquin Jares 2017-08-07 19:11:18 UTC
I have tried several combinations and couldn't repro in 4.7. The original bug has to do with improperly created mdbs, but all that code changed in 4.4-4.6. I'm marking this as resolved for QA verification. Please @Matt do reopen if the error reappears.
Comment 9 Saurabh Paunikar 2017-09-29 10:48:23 UTC
Verified on

Microsoft Visual Studio Enterprise 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.7.02053

Installed Version: Enterprise

Xamarin   4.7.10.6 (ac395c3ba)

Xamarin.Android   8.0.0.23 (5257e43)

Xamarin.iOS   11.2.0.8 (9a9f054)

Detailed build Info: https://gist.github.com/saurabh-paunikar/2ec11234e03ad14e7ae9311eb69eb91e

Not able to reproduce this issue hence Marking it as verified as not reproducible