Any idea what causes System.FormatException on LogCatEntry.Parse in Visual Studio debugger?

I_am_a_duckI_am_a_duck GBUniversity ✭✭
edited July 2014 in Xamarin.Android

When running an Android app from Visual Studio on a CUBOT G10 device (Android 4.2.2) the VS debug log fills with these errors, and I get no useful log output at all:

=================

Error getting android log entry

System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at Xamarin.VisualStudio.Android.LogCatEntry.Parse(LogCatEntry obj, String entry)
at Xamarin.VisualStudio.Android.LogCatControl.listView1_RetrieveVirtualItem(Object sender, RetrieveVirtualItemEventArgs e)

=================

Note 1: The app still builds, deploys and runs on the device, but without debug log it's hard to see what's going on!
Note 2: My Moto XT1032 and other devices I've tested from Android 4.1 to 4.4 all run without this problem.

Has anyone else seen this? I searched within these forums and on Google but can't find any references to it.

Cheers,
Philip

Best Answer

Answers

  • FlorianHarrFlorianHarr DEMember

    Same problem here. Seems to be a bug from what it looks like to me

  • I_am_a_duckI_am_a_duck GBUniversity ✭✭

    Florian, please see my comment here in the VS forum:
    http://forums.xamarin.com/discussion/comment/66751/#Comment_66751

    HTH!

  • nbevansnbevans USMember ✭✭✭

    Getting same here. Seems to cause VS to lag a lot too, when the Galaxy S5 is connected to the machine.

    System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
    Parameter name: length
    at System.String.Substring(Int32 startIndex, Int32 length)
    at Xamarin.VisualStudio.Android.LogCatEntry.Parse(LogCatEntry obj, String entry)
    at Xamarin.VisualStudio.Android.LogCatControl.listView1_RetrieveVirtualItem(Object sender, RetrieveVirtualItemEventArgs e)

    Error getting android log entry

  • I_am_a_duckI_am_a_duck GBUniversity ✭✭

    Looks like a few people are seeing this on different devices - could someone from Xamarin can comment on this?

  • deckertron9000deckertron9000 USUniversity ✭✭✭

    I'm seeing this issue as well. Very annoying whilst trying to debug.

  • PeterDavisPeterDavis USMember ✭✭✭
    edited August 2014

    Yes, this is incredibly annoying. I'm also seeing this on a Galaxy S5 and it makes debugging a PITA.

  • deckertron9000deckertron9000 USUniversity ✭✭✭
    edited August 2014

    I've found that restarting Visual Studio 2013 sometimes solves this problem for a few debug sessions before filling the output window with useless logcat exceptions again. Does that work for anyone else?

  • JeremyKolbJeremyKolb USMember ✭✭✭
  • Peter.4192Peter.4192 DKMember ✭✭
    edited August 2014

    Same behavior here. Restart VS helps for a while.
    But problems with seeing debug lines anyway. Has started recently.

  • ChrisAtkinsonChrisAtkinson AUMember, University

    Same here. I have to either disconnect my Sony Xperia Z1 (and/ or restart VS) in order to keep working for a short time before it happens again.

    I have emailed the support guys at Xamarin, so hopefully they will be able to shed some light on this.

    Like @Peter.4192, it seems to have only started recently.

  • deckertron9000deckertron9000 USUniversity ✭✭✭

    Just a quick tip that's been helping me survive this problem: if you want to view output from a debugging session, unplug your device after debugging and then switch the output pane to Debug. Unplugging the device stops the incoming LogCat exceptions and allows you to view your output. Of course this is still a pain, but I've been able to track down a couple exceptions at least.

    @ChrisAtkinson‌ would you mind posting back here if/when you get a response from support?

  • ChrisAtkinsonChrisAtkinson AUMember, University

    I have contacted @JohnMiller in support and he is going to take it up with the engineering team. When I hear anything else, I will post it here.

  • I_am_a_duckI_am_a_duck GBUniversity ✭✭

    Hi John,

    Thanks for the Bugzilla link; at least we can track the progress of this issue on there now. From the stack trace given in the error message it appears to be a good old fashioned string parsing error in a call to String.Substring from LogCatEntry.Parse - presumably the string it's attempting to crack is either too short or empty (but not null).

    Regarding reproduction, it's device-specific but completely reliable on my CUBOT G10 test device (Android 4.2.2), as originally reported at the top of this thread, and, for those who don't have one of those devices, others in this thread have reported it as being reliable on Samsung Galaxy S5 devices.

    It doesn't seem to matter what the app is; just running anything under the VS2013 debugger on certain devices is what appears to produce the problem.

    HTH,
    Philip

Sign In or Register to comment.