Visual Studio 2015 - Impossible to debug my Xamarin.Forms Android app

SamihSamih BEMember ✭✭
edited January 2016 in Xamarin.Forms

Hello,

When I start my app and push on a button for instance, I get these messages & my app crashs.
1. It works fine without debugging mode
2. It works fine with Xamarin Studio on Mac OS

It is really annoying since I can't use breakpoints, I can't see anything about the locals...
=> I really need those things in order to ship a bug-free app...

I'm currently using DisplayAlerts to show Exceptions, but it's not a viable solution.

I work with a PCL & a Xamarin.Android project where I access features like device's Scanner, Bluetooth...

Thank you very much for your time.

Answers

  • AdamPAdamP AUUniversity ✭✭✭✭✭

    @Samih - a common problem is Fast Deployment. Go to your properties of your Android project and uncheck the Fast Deployment option. Then try in Debug and let me know how you go.

  • SamihSamih BEMember ✭✭
    edited January 2016

    @AdamP - Thanks for your answer. I tried but unfortunately I get the same problem.

  • PaulDiPietroPaulDiPietro USXamarin Team Xamurai

    @Samih - Sorry you're having troubles. Do you happen to have a reproduction project to share that we can take a look at?

  • AdamPAdamP AUUniversity ✭✭✭✭✭
    edited January 2016

    @Samih - to me it sounds like your Visual Studio settings are out. If you go to Tools > Options then expand debugging are Enable Breakpoint Filters set?

    And can you actually deploy in debugging? And if not can you please post any errors, exceptions or the output window here.

  • SamihSamih BEMember ✭✭

    Thanks for your answers guys.

    @AdamP - Yes, it's done, but Visual Studio is okay. I can debug another projects.
    @PaulDiPietro - Sorry, I don't have any reproduction project because if I create a project from sratch, I don't get this problem...

    I think I have this issue because of what I'm doing within my Android project (for instance: pairing a bluetooth printer, printing, scanning barcodes) so I'm aware that it won't be easy to figure out what happens there...

    Have someone already got this kind of error messages while working on Visual Studio ?

  • AdamPAdamP AUUniversity ✭✭✭✭✭

    @Samih - can you make sure a new project that is debugging properly has all the same settings in the Properties section of the one having trouble. Its the only place I can think of that would cause these types of issues if other projects are working fine.

  • SamihSamih BEMember ✭✭

    @AdamP - Same settings except (for my project where debugging** isn't **working) :

    • A component - https://components.xamarin.com/view/emdk-component
    • It references an external DLL -> Symbol.XamarinEMDK that my Android-specific Scanner class implements (public class AndroidScanner : Java.Lang.Object, EMDKManager.IEMDKListener, IScanner)

    Do you think it could come from this ? For example, that library makes me define an OnOpened and OnClosed method in my AndroidScanner class.
    The counter argument is I can debug the same solution with the same component on Mac with Xamarin Studio...

  • AdamPAdamP AUUniversity ✭✭✭✭✭

    @Samih - it doesn't quite make sense that a component would disable debugging but I could be mistaken.

    Have you compared the .proj files. As in actually opening them up in notepad and looking for any differences?

  • Did you ever solve this? I'm having the same problem with one of our projects. Visual Studio 2015 crashes every time a breakpoint is hit and it's really killing my productivity.

  • SamihSamih BEMember ✭✭
    edited March 2016

    @AdamP - Thanks for your answer. Unfortunately, there isn't any difference in .csproj files.

    Update :
    Debugger actually doesn't work on Xamarin Studio for Mac OS neither. It makes my app crash after 1 or 2 breakpoints.
    I work with a Zebra device with an integrated scanner and I think the scanner stuff may rise this issue.

    @JacobRicketts - Sorry, I haven't solved this.

    Please share if you find anything. Thx.

  • AntaoAlmadaAntaoAlmada PTMember ✭✭
    edited April 2016

    Not using Forms but same problem here. Installed Xamarin for VS for first time (Community 2015 Update 2 released yesterday) and it crashes when I set a breakpoint...

  • AlmaJensen.9398AlmaJensen.9398 USMember ✭✭✭

    I've had issues that I couldn't overcome either when debugging Xamarin Forms Android projects. But the issue seemed to center around using a 64bit Android Marshmallow device. Someone else pointed out to me that some of the latest LG devices are having issues but there was a bug fix in the Alpha channel. This was maybe a month ago. I didn't have any issues however with Lollipop or earlier devices. I would suggest trying it on some older devices. Oh and by the way the app would run just fine in release mode.

  • AlmaJensen.9398AlmaJensen.9398 USMember ✭✭✭

    I've run into problems debugging xamarin forms projects on an Android device but the device was Marshmallow and 64 bit. The same project though would run just fine on an Galaxy s5 running Lollipop. The app would run just fine on both devices however if the mode was set to release mode. I believe there's a bug fix for some of the newer high end devices in either the alpha or beta channels.

  • PeteVickersPeteVickers GBMember ✭✭

    Hi,
    my S6 has just updated to Marshmallow, and I am now having problems deploying and testing my apps. I thought it was the 'Use legacy DHCP client' in the developer settings of the device, as I had some success when I turned this on, but it now doesn't seem to matter.

    I hit F5 in VS2015 to run the app, it deploys fine, starts up (I see the white screen with the app title appear), and then the app stops.
    I see....
    04-05 08:41:25.891 D/Mono (24601): [0xd951e930] worker starting
    referenceTable GDEF length=814 1
    referenceTable GSUB length=11364 1
    referenceTable GPOS length=47302 1
    04-05 08:41:25.901 F/art (24601): art/runtime/fault_handler.cc:117] Check failed: !initialized_
    Debugger Connection Lost: Debugger lost connection to the running application. Likely this means the application terminated unexpectedly.

    More details can usually be found in the device's debug log:

    http://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/android_debug_log/
    Exception of type 'Mono.Debugger.Soft.VMDisconnectedException' was thrown.

    Sometimes the app starts to run, and then just crashes out. Just tried it out in Xamarin Studio after a suggestion in Forms forums and it seems to work fine - so looks like a VS2015 problem?

    Tried it before and after Update2 with the same frustrating results.

    Pete

  • OmarSOmarS USMember ✭✭

    Hi, me and my colleagues just upgraded to android 6 and we're having the same issue.

    Cannot debug with visual studio on our devices :
    Exception of type 'Mono.Debugger.Soft.VMDisconnectedException' was thrown.

    Any info regarding this issue?

Sign In or Register to comment.