Breakpoints do not work anymore in VS after upgrading to Xamarin 2.0

Hello,

Yet another problem with Xamarin 2.0. Since I upgraded to Xamarin.Android (from private Beta 3), the debugging doesn't work at all in VS2012 for my existing Android projects. The output log is fine, but breakpoints refuse to work on a physical device or in the emulator. Creating a new project from scratch works though.

I had a ton of problems a few weeks ago just to make debugging work at all (had very frequent disconnections, VS would hang, had to connect/reconnect device, etc.). I managed to find a setup that works well for Debug: Uncheck "Fast deploy", no linking, check "Use Shared Runtime". However, since I installed the Xamarin 2.0 beta 3, the breakpoints have stopped working on my projects.

I tried to delete the bin/obj directories, cleaned up the solution, change debug settings, change API version, etc. and nothing works except creating a new project. My .csproj files haven't changed since installing Xamarin 2.0. I went through all solutions in this thread: http://mono-for-android.1047100.n5.nabble.com/debugger-breakpoints-4-4-41-td5712641.html

Why is it so hard to make debugging barely work with Mono for Android? MonoTouch works very well (except the VS version), but I have only encountered trouble with Mono for Android. Please help me, because I already wasted several hours on this problem instead of coding actual stuff, and it is very frustrating.

Here is my .csproj file: http://pastebin.com/XbPpJRHh

Thanks,
Yanick

Posts

  • YanickCastonguayYanickCastonguay CAMember, Beta

    By the way, I got to reproduce the issue by creating a new Android project (with default settings, API 15), the breakpoint works the first time. As soon as I change the project settings (i.e. uncheck Fast Deploy), breakpoints completely stop working from that point, whatever I try to do (check Fast Deploy, rebuild, delete bin/obj directories, etc.).

    Not very happy here!

  • YanickCastonguayYanickCastonguay CAMember, Beta

    Now trying to use Xamarin Studio on Mac to try to debug my project... but Xamarin Studio keeps giving an error when trying to activate Xamarin.Android.

    I'm now seriously considering uninstalling Xamarin 2.0 and go back to a previous version... just to be able to work at all on my project.

  • FZelleFZelle DEMember ✭✭✭

    Same here.
    Will go back to previous version until Debugger is fixed.

  • YanickCastonguayYanickCastonguay CAMember, Beta

    Quick update: I have exactly the same issue at work with a different VM and Xamarin account. I'm no longer able to use breakpoints, but the debug log works fine.

  • KarlWaclawekKarlWaclawek CAMember ✭✭

    Can confirm for Visual Studio 2012, latest Xamarin (upgraded a few days ago).
    Breakpoints worked at first (flakey, as usual, but mostly working).

    As of today sometime this morning, breakpoints do not work anymore.
    Even a brand new project created from template will not stop at breakpoints.
    Debugging on device (Android 4.1.2), targeting API 15.

  • KarlWaclawekKarlWaclawek CAMember ✭✭

    Somehow I got it working again. Not sure how.
    Did two things:
    1) Shut down and rebooted Win8 and device.
    2) I noticed recently this got added to the VS project file:

     <AndroidLinkSkip />
     <EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
     <BundleAssemblies>False</BundleAssemblies>
    

    I removed these three lines in the project file.

    One of these seems to have done the trick, I guess.
    Still problems with breakpoints in threads, though.

  • JeffreyStedfastJeffreyStedfast USXamarin Team Xamurai
    edited February 2013

    This seems to be the same issue as this bug: https://bugzilla.xamarin.com/show_bug.cgi?id=9433

  • MStecherMStecher USMember

    confirmation for this problem. seems there are some more problems with xamarin 2.0, like random crashes in release builds...

  • softlionsoftlion FRBeta ✭✭✭

    Yes it seems to be a regression.

    "This bug only seems to happen if fast Deployment is switched off."

    This is the trick. Switch on fast deploy.

  • YanickCastonguayYanickCastonguay CAMember, Beta

    Fast deploy debugging is very unstable for me, I had to switch it off to be able to debug my application at all. Fast deploy stops the debugging all the time for no reason.

    Haven't tried Fast Deploy on the emulator though.

    So this isn't a solution for me. Debugging was quite stable with the last version of Mono for Android, so there's no reason this version shouldn't be the same!

  • MStecherMStecher USMember

    Yes with fast deploy it works most of the time... but Library debugging still isn't working...

  • DahevosDahevos FRMember
    edited February 2013

    Same here. And fast deployment bug in synchronize lib the first time when I launch the debug (on device).

  • DanielHindrikesDanielHindrikes SEMember ✭✭

    It worked when I deleted True from debug configuration in the csproj file.

  • JenniferRostenneJenniferRostenne USMember ✭✭
    edited March 2013

    Same issue after upgrading to Xamarin.Android 4.6 on Visual Studio 2010.

    For some reason (bug?) the following line gets added into the .csproj file:
    inside the debug configuration

    <EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
    

    After manually removing it debugging works again.

  • JonathanPryorJonathanPryor USXamarin Team Xamurai

    The <EmbedAssembliesIntoApk/> line corresponds to the "Fast deployment" checkbox in Project Options/Properties. When $(EmbedAssembliesIntoApk) is True, "Fast deployment" is disabled. If $(EmbedAssembliesIntoApk) is False or not present (the default is False for Debug builds), then "Fast deployment" is enabled.

  • BradRobinsonBradRobinson AUMember ✭✭✭
    edited March 2013

    Just wondering if there's a fix for this coming? For me,

    Fast deployment = over 1 minute to deploy :( and debugger works. :)
    Slow deployment = 10 second deploy :) and debugger doesn't work :(

    (running on an Asus Nexys 7)

  • DanBelcherDanBelcher USMember ✭✭

    I am having a similar problem in Xamarin Studio (4.0.7 build 3 - Business Edition). I am no longer able to debug at all with Droid projects. I have tried to debug on emulators, as well as devices (Nexus 7 and 10).

  • rominagalavottirominagalavotti USMember

    I have the same error. The output is

    Mono.AndroidTools.AndroidLogger Error: 0 : [E:]: Error checking adb start-server status
    System.NullReferenceException: Referencia a objeto no establecida como instancia de un objeto.
    en Mono.AndroidTools.Internal.AdbStartWindowsServerProcess.ProcessExited(Object state, Boolean timedOut)

    I need help.
    Thanks.

  • rominagalavottirominagalavotti USMember

    Another error was

    05-23 12:28:57.422 I/dalvikvm( 411): threadid=4: reacting to signal 3
    05-23 12:28:57.482 I/dalvikvm( 411): Wrote stack traces to '/data/anr/traces.txt'
    05-23 12:28:57.532 W/monodroid-gc( 411): GREF GC Threshold: 1800
    Loaded assembly: /data/data/nmcandsrvwstest.nmcandsrvwstest/files/.override/nmcandsrvwstest.dll
    Loaded assembly: /data/data/nmcandsrvwstest.nmcandsrvwstest/files/.override/nmcandsrv.dll
    Loaded assembly: /data/data/nmcandsrvwstest.nmcandsrvwstest/files/.override/nmcandwebservices.dll
    Loaded assembly: /data/data/nmcandsrvwstest.nmcandsrvwstest/files/.override/nmcandbrgdisoparser.dll
    Loaded assembly: Mono.Android.dll [External]
    Loaded assembly: System.Core.dll [External]
    In mgmain JNI_OnLoad
    The program 'Mono' has exited with code 255 (0xff).

  • rominagalavottirominagalavotti USMember

    And if I choose "Release mode" it works.....Any suggestions???
    thanks

  • rominagalavottirominagalavotti USMember

    I have :

    Xamarin Studio
    Version 4.0.8 (build 2)
    Installation UUID: xxxx
    Runtime:
    Microsoft .NET 4.0.30319.17929
    GTK 2.24.13
    GTK# (2.12.0.0)

    Xamarin.Android
    Version: 4.6.6 (Business Edition)
    Android SDK: C:-------------\Android\android-sdk
    Supported Android versions:
    2.1 (API level 7)
    2.2 (API level 8)
    2.3 (API level 10)
    3.1 (API level 12)
    4.0 (API level 14)
    4.0.3 (API level 15)
    4.2 (API level 17)
    Java SDK: C:-----------------\Java\jdk1.6.0_27

    Build Information
    Release ID: 400080002
    0a09117dec1aed78c735ac46f7a50ae7d12f7a7a
    Build date: 2013-05-16 17:54:42Z
    Xamarin addins: 78d0437c3f92ae13042f81e5fd9487e2c28d5fbc

    Operating System
    Windows 6.1.7600.0 (64-bit)

Sign In or Register to comment.