This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 31855 - Cannot debug with LG G4
Summary: Cannot debug with LG G4
Status: VERIFIED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: Debugger (show other bugs)
Version: 5.2
Hardware: PC Windows
: --- normal
Target Milestone: 6.1 (C7)
Assignee: dean.ellis
URL:
: 33485 33832 35374 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-07-11 21:36 UTC by Mark Fredrickson
Modified: 2016-05-03 18:19 UTC (History)
18 users (show)

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


Attachments

Description Mark Fredrickson 2015-07-11 21:36:11 UTC
I just updated my LG G3 to a G4 and can no longer debug my Xamarin Android app with VS 2010, VS 2013, or Xamarin Studio. When I start the debugger the app starts then after about 4 seconds just quits. Without debugging the app runs fine. Eclipse has no problem debugging. The main difference in the two phones is that the G4 has a 64 bit processor and is running Android 5.1. I have checked the threads relating to this, have the latest drivers installed, and tried the suggestions but nothing works. I even reset my G4 to factory settings but that didn't help either.
Comment 1 Tristan 2015-07-22 00:46:23 UTC
I too cannot debug using Visual Studio 2013 and an LG G4. My app launches and then crashes a few seconds later. I have had success launching the app using Xamarin Studio, however I cannot hit breakpoints.

Xamarin Studio
Version 5.9.4 (build 5)
Installation UUID: d6a6ac2d-6f41-4d5e-89c7-609a98b08d65
Runtime:
	Microsoft .NET 4.0.30319.18449
	GTK+ 2.24.22 (MS-Windows theme)
	GTK# 2.12.26

Xamarin.Android
Version: 5.1.4 (Business Edition)
Android SDK: 
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
Java SDK: C:\Program Files (x86)\Java\jdk1.6.0_39
java version "1.6.0_39"
Java(TM) SE Runtime Environment (build 1.6.0_39-b04)
Java HotSpot(TM) Client VM (build 20.14-b01, mixed mode, sharing)

Xamarin Android Player
Not Installed

Build Information
Release ID: 509040005
Git revision: 8010a90f6e246b32364e3fb46ef2c9d1be9c9a2b
Build date: 2015-06-08 17:16:25-04
Xamarin addins: 7e93e9c3503f28770f23ce1b7eafd829919f18e8

Operating System
Windows 6.2.9200.0 (64-bit)
Comment 2 tom.bull 2015-07-31 07:59:15 UTC
I have the exact same experience as Tristan.  

Xamarin Studio
Version 5.9.4 (build 5)
Installation UUID: 923fa3f0-6f3f-443d-af1a-6f49f6d7c512
Runtime:
	Microsoft .NET 4.0.30319.34209
	GTK+ 2.24.22 (MS-Windows theme)
	GTK# 2.12.26

Xamarin.Android
Version: 5.1.4 (Business Edition)
Android SDK: C:\Users\Thomas\AppData\Local\Android\android-sdk
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.3   (API level 18)
		4.4   (API level 19)
		5.0   (API level 21)
Java SDK: C:\Program Files (x86)\Java\jdk1.6.0_39
java version "1.6.0_39"
Java(TM) SE Runtime Environment (build 1.6.0_39-b04)
Java HotSpot(TM) Client VM (build 20.14-b01, mixed mode, sharing)

Xamarin Android Player
Version: 0.4.4
Location: C:\Program Files\Xamarin Android Player\DeviceManager.exe

Build Information
Release ID: 509040005
Git revision: 8010a90f6e246b32364e3fb46ef2c9d1be9c9a2b
Build date: 2015-06-08 17:16:25-04
Xamarin addins: 7e93e9c3503f28770f23ce1b7eafd829919f18e8

Operating System
Windows 6.2.9200.0 (64-bit)
Comment 3 David Karlaš 2015-09-08 04:14:49 UTC
*** Bug 33485 has been marked as a duplicate of this bug. ***
Comment 4 Mark Downes 2015-09-22 11:27:31 UTC
I am experiencing the same issue when I try to debug my Xamarin Forms app on my G4 running Android 5.1.
Comment 5 Ashley Gazich 2015-10-22 16:09:19 UTC
## Report from another customer:
Cannot debug using an LG G4 device running API 22. Xamarin Studio successfully deploys the application to the device and the logcat can get the output from the device, but breakpoints set in XS are ignored.

In Visual Studio 2013, debugger runs for 5 - 10 seconds before quitting and closing the application on the phone. Code was originally developed in Visual Studio 2013 using the Xamarin plugin. 

Note: When creating and editing a project for Android in Visual Studio, even though it is possible to open and compile the project in Xamarin Studio, the files are uneditable in Xamarin Studio. Must go back to Visual Studio to make any changes.

Xamarin support note:
Possibly related with similar behavior: Bug 33832 - Cannot debug on LG G3 - 5.0 Lollipop with VS 2013


## Customer version information

Microsoft Visual Studio Premium 2013
Version 12.0.40629.00 Update 5
Microsoft .NET Framework
Version 4.5.51209

Installed Version: Premium

LightSwitch for Visual Studio 2013   06191-004-0454001-02346
Microsoft LightSwitch for Visual Studio 2013

Team Explorer for Visual Studio 2013   06191-004-0454001-02346
Microsoft Team Explorer for Visual Studio 2013

Visual Basic 2013   06191-004-0454001-02346
Microsoft Visual Basic 2013

Visual C# 2013   06191-004-0454001-02346
Microsoft Visual C# 2013

Visual C++ 2013   06191-004-0454001-02346
Microsoft Visual C++ 2013

Visual F# 2013   06191-004-0454001-02346
Microsoft Visual F# 2013

Visual Studio 2013 Code Analysis Spell Checker   06191-004-0454001-02346
Microsoft® Visual Studio® 2013 Code Analysis Spell Checker

Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

ASP.NET and Web Tools   12.5.60814.0
Microsoft Web Developer Tools contains the following components:
Support for creating and opening ASP.NET web projects
Browser Link: A communication channel between Visual Studio and browsers
Editor extensions for HTML, CSS, and JavaScript
Page Inspector: Inspection tool for ASP.NET web projects
Scaffolding: A framework for building and running code generators
Server Explorer extensions for Microsoft Azure Web Apps
Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Microsoft Azure

ASP.NET Web Frameworks and Tools 2012.2   4.1.21001.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.30612.0
For additional information, visit http://www.asp.net/

Common Azure Tools   1.6
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

DataFactoryProject   1.0
Microsoft Data Factory Package

Microsoft Azure Data Factory Node Node   1.0
Azure Data Factory extension for Visual Studio Server Explorer.

Microsoft Azure HDInsight HQL Service   2.0.2600.0
Language service for Hive query

Microsoft Azure HDInsight Tools for Visual Studio   2.0.2600.0
An integrated development environment for HDInsight application development.

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

Microsoft Azure Tools   2.7
Microsoft Azure Tools for Microsoft Visual Studio 2013 - v2.7.30818.1601

NuGet Package Manager   2.8.60723.765
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Office Developer Tools for Visual Studio 2013 ENU   12.0.30626
Microsoft Office Developer Tools for Visual Studio 2013 ENU

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

Release Management for Visual Studio Package   1.0
Release Management for Visual Studio

SQL Server Data Tools   12.0.41012.0
Microsoft SQL Server Data Tools

Windows Phone 8.1 SDK Integration   1.0
This package integrates the tools for the Windows Phone 8.1 SDK into the menus and controls of Visual Studio.

Workflow Manager Tools 1.0   1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin   3.11.1537.0 (a11147b)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   5.1.7.12 (53fce3730830417896a42f365a5ba35f1ee58d9d)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.Forms Intellisense   1.0
Provides intellisense for Xamarin.Forms in the XML editor.

Xamarin.iOS   9.0.1.0 (73db6324ad6864caae30bf4010c185598d262e69)
Visual Studio extension to enable development for Xamarin.iOS.

Xamarin.iOS Unified Migration   1.0
Automated migration for Xamarin iOS Classic projects to Unified

Xamarin.TestCloud.Integration   1.0
Early preview of Xamarin Test Cloud integration




=== Xamarin Studio ===

Version 5.9.7 (build 22)
Installation UUID: 1a8d5a66-4d5f-4c2c-b2b2-5b07835abc34
Runtime:
	Microsoft .NET 4.0.30319.34209
	GTK+ 2.24.22 (MS-Windows theme)
	GTK# 2.12.26

=== Xamarin.Android ===

Version: 5.1.7 (Business Edition)
Android SDK: C:\Users\PGervasio\AppData\Local\Android\sdk
	Supported Android versions:
		4.0.3 (API level 15)
		4.2   (API level 17)
		4.4   (API level 19)
		5.0   (API level 21)
		5.1   (API level 22)
		6.0   (API level 23)
Java SDK: C:\Program Files (x86)\Java\jdk1.7.0_71
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) Client VM (build 24.71-b01, mixed mode, sharing)

=== Xamarin Android Player ===

Not Installed

=== Build Information ===

Release ID: 509070022
Git revision: 6bd1f169df44ca96addf8a035316c535a4fa46fa
Build date: 2015-09-30 10:13:51-04
Xamarin addins: 1c3e5c0859bdfec0ecd481a57ad6c03bc22f5536

=== Operating System ===

Windows 6.1.7601.65536 (64-bit)


## Xamarin support note
Possibly related with similar behavior: Bug 33832 - Cannot debug on LG G3 - 5.0 Lollipop with VS 2013
Comment 6 Mark Fredrickson 2015-10-22 18:44:06 UTC
Ref: ## Xamarin support note
Possibly related with similar behavior: Bug 33832 - Cannot debug on LG G3 - 5.0
Lollipop with VS 2013

I have a G3 with Android 5.01 and it debugs just fine but my G4 with Android 5.1 does not.
Comment 8 Jonathan Pryor 2015-11-03 15:36:29 UTC
*** Bug 33832 has been marked as a duplicate of this bug. ***
Comment 9 Jonathan Pryor 2015-11-03 15:38:55 UTC
Given adb:

https://developer.xamarin.com/guides/android/troubleshooting/troubleshooting/#Android_Debug_Log_Output

Is the `setprop` command *persistent*? Meaning, after using setprop, is the value readable from getprop?

$ adb shell setprop debug.foo.bar 1
$ adb shell getprop debug.foo.bar
1
Comment 10 Jonathan Pryor 2015-11-03 15:41:25 UTC
What we suspect (fear) is happening is that these particular LG devices are "special", in that setprop is *not* persistent, resulting in output such as:

$ adb shell setprop debug.foo.bar 1
$ adb shell getprop debug.foo.bar
# nothing

This is currently problematic, because both Visual Studio and Xamarin Studio use Android System Properties in order to provide information to the debugger, such as the debugger timeout, the port to connect to, and other extremely important information.

If `setprop` isn't persistent, then the app cannot read this information, and the debugger will never attach.

So we have a *theory* that would explain the observation. We would appreciation confirmation that this is what you observe. (We see this non-persistent behavior on an internal LG G4.)
Comment 11 Peter Collins 2015-11-03 15:47:17 UTC
*** Bug 35374 has been marked as a duplicate of this bug. ***
Comment 12 Mark Fredrickson 2015-11-03 16:03:43 UTC
I'd be happy to help.Just let me know what I have to do. I'm only available Thursday this week and back on Monday.
Comment 13 Peter Collins 2015-11-04 16:59:15 UTC
@Mark please let us know if you're able to set system properties on the affected device:

To set you'd enter:
> adb shell setprop debug.foo.bar 1

Then, to see if the setting was successful, you can run the following:
> adb shell getprop debug.foo.bar

If the getprop call returns a value, setting succeeded. If that command doesn't return anything, setting failed.
Comment 14 Tristan 2015-11-04 17:10:32 UTC
LG G4
>adb shell setprop debug.foo.bar 1

>adb shell getprop debug.foo.bar


Samsung Galaxy Tab4 
>adb shell setprop debug.foo.bar 1

>adb shell getprop debug.foo.bar
1
Comment 15 Peter Collins 2015-11-04 20:17:49 UTC
@Tristan you're not experiencing the same behavior on the Galaxy Tab 4 right? I'm assuming that result was just for comparison.
Comment 16 Tristan 2015-11-04 21:10:53 UTC
Yes you're right it was just for comparison. Galaxy Tab 4 works fine.
Comment 17 Mark Downes 2015-11-05 08:44:15 UTC
@Jonathan, I also ran those two commands against my LG G4 with the same result, i.e. no result on the "get" command.
Comment 18 Alexey Karamyshev 2015-11-05 09:06:38 UTC
I have the same problem with LG Leon H324. I've tried setprop/getprop - and
getprop gave me nothing.
I've tried it with another devices - all works good.
Comment 19 Jonathan Pryor 2015-11-05 12:14:44 UTC
Comment #14 through Comment #18 largely confirms my theory from Comment #10: we're screwed on these devices. :-)

We have an idea for how to fix things, but we have no confident timeline for doing so.

Does anybody know how to file a bug with LG, perhaps ask them to re-enable `adb shell setprop` on their devices? I tried to find somewhere to do so, but came up empty.
Comment 20 Mark Fredrickson 2015-11-06 14:24:17 UTC
Well, I get a 1 value on my Sprint G3 and nothing on my Sprint G4. Bummer. 

Would this be something that might be fixed in the next Android update? I'm currently on 5.1.

What if we rooted out phone and installed CyanogenMod Marshmallow for the G4? Reckon that would fix the problem? Here is a link for installing Android 6.0 on the G4 - http://www.ibtimes.co.in/lg-g4-android-marshmallow-release-update-how-install-stock-rom-smartphone-tutorial-653021. I used to do this on my very early phones but haven't rooted a phone for quite a while. Anybody up for the challenge?
Comment 21 Jonathan Pryor 2015-11-11 15:21:03 UTC
> Would this be something that might be fixed in the next Android update.

No.

We might get this done for Cycle 7, aka Xamarin.Android 6.1 (and note that cycle6/6.0 isn't even stable yet!), but it may get bumped for higher priority work.

It will get fixed as we are able to fix it.

> What if we rooted out phone and installed CyanogenMod Marshmallow for the G4?
> Reckon that would fix the problem?

Probably.
Comment 22 Mark Fredrickson 2015-11-11 17:59:50 UTC
I'm currently using Cycle 6 so if you want me to test anything let me know.

It looks like if you root your phone and install this ROM it works. But if you guys are going to fix it in VS then I think I'll wait.

See the last post on this page:

http://forum.xda-developers.com/sprint-g4/development/zv6-ultrapop-rom-v1-2-ls991-g4-t3211725/page22
Comment 23 Arthur 2015-11-18 13:15:07 UTC
Same problem here (LG G4 Android 5.1)

Side note: Recently switched from Nokia Lumia 920 to LG G4. Although I've been programming Android phones for quite a while, using it on a daily base is a different experience. And now I fully understand why people praise the ease of use of iOS and WinPhones...
Comment 24 Mark Fredrickson 2016-01-01 02:51:27 UTC
@Jonathan Pryor - can you give a very rough ETA for Cycle 7?
Comment 25 dean.ellis 2016-01-11 11:40:28 UTC
This has been fixed in androidtools/master/e5c1e1df

The new code will set the debug properties via a property file in addition to a property, this should allow devices like the LG 4G to debug .

Android Tools was bumped in monodroid/master/a634ab85 Still needs to be done for Xamarin Studio. In which case this will be in cycle 7
Comment 26 Mark Fredrickson 2016-01-12 17:45:31 UTC
My Sprint LG G4 was just updated to Android 6.0 and debugging now works except for Step Into which causes a crash. Most of the time the debugger crashes immediately upon a Step Into however sometimes the Step Into works but then when your Run, it crashes. I can get by with this for now. Are you interested in any debug logs or just wait for Cycle 7?
Comment 27 Mark Fredrickson 2016-01-13 17:19:32 UTC
Well, don't know what happened but I can no longer debug on my LG G4. It worked like I said above right after the update but then I used the phone during the day to listen to some podcasts, then did some Android app debugging with Eclipse and then went back to VS and the debugger hangs starting the app. I have to force close the app and End Task VS. Tried lots of things to get it to work again but no luck. I'm back waiting for Cycle 7. Any time frame on it's release?
Comment 28 Mark Downes 2016-01-13 18:05:30 UTC
I often have problems with VS hanging when initiating debug - not even using a G4. Try closing VS, deleting all bin/obj files (I use a .bat file for this - sad that I have one for this, I know) and then reopen VS and the solution and try debugging again. Keep hoping that Xamarin will address this one day.
Comment 29 Mark Fredrickson 2016-01-13 18:32:44 UTC
@Mark Downes - Thanks a lot. This worked. I'll post this solution over on the LG G4 thread and credit you.
Comment 30 Mark Fredrickson 2016-01-13 22:31:44 UTC
I just tested setprop and getprop and the data is persisted with Android 6.0. But debugging is still real shaky. Even with @Mark Downes workaround it still hangs a lot of the time. Are there other issues here or will @Dean Ellis fix and Cycle 7 work? Has anyone from Xamarin tested Cycle 7 VS debugging with a LG G4 running Android 6.0? Maybe this is not a LG G4 issue but an Android 6.0 issue?
Comment 31 Jonathan Pryor 2016-01-14 20:08:56 UTC
@Fredrickson: RESVOLED FIXED only means that the bug has been fixed internally. It does *not* mean that the fix has been released and is generally available.

The release notes specify which bugs are fixed in a given release.

This particular bug -- Bug #31855 -- is only regarding certain LG devices which do not store system properties via `adb shell setprop`. If your debugging experience is unreliable and/or doesn't work and your device *does* support `adb shell setprop`, please file a separate bug so that it may be tracked appropriately.
Comment 32 Mark Fredrickson 2016-01-15 17:59:10 UTC
@Jonathan Pryor - Got it. Bug #35739 is the one that is occurring now with my LG G4 running Android 6.0. Sure would like to see that one get resolved soon.
Comment 33 Abhishek 2016-03-11 18:49:47 UTC
I have checked this issue with the latest master build: Xamarin.VisualStudio_99.0.0.1758_1c2c2a19f00fce64b319730d7dd90d78a3709a7b.

Now this issue is working fine. I am successfully able to hit the breakpoint and debugger does not disconnect.Here is the screencast: http://www.screencast.com/t/9y4gkVyntSj.

Also with master build both on Mac and Windows XS:

Windows Build:

XamarinStudio-6.0.0.4301_12851943f4d67460778012cd300e15e79134769d

Mac Build:

XamarinStudio-6.0.0.4327_5f81318aabc3aa90caea1c2e0eb99b444725f902
MonoFramework-MDK-4.3.3.609.macos10.xamarin.universal_a6289bcc41fe9b8b25b1fd6b127e09db3f48ef41
mono-android-6.0.99-523_5c51b998cad060ed52967d4379d55bbb0ba829da

Now I am successfully able to hit the breakpoint with the device LG G3 Beat (version 5.0.2) both on Mac and Windows XS.

Screencast for Windows XS: http://www.screencast.com/t/BsKAuPlX6d
Application Output: https://gist.github.com/Abhishekk360/08b4ea6bbf64421fd5da
Android Tool Log: https://gist.github.com/Abhishekk360/e8c9330ef28b85f333f6

Screencast for Mac XS: http://www.screencast.com/t/G2tHCVVW
Application Output: https://gist.github.com/Abhishekk360/c10194699b77f8d3d2c5
Android Tool Log: https://gist.github.com/Abhishekk360/6f405a2d779b122d8daa

Hence closing this issue.

Thanks
Comment 34 Abhishek 2016-05-03 18:19:52 UTC
I have checked this issue with the latest C7 build both on Mac and Windows Environment.

***********************
Windows Environment:
***********************

Xamarin.VisualStudio_4.1.0.462_fb9e9f3c82ef86b653a43f13acc51902d66570d7
XamarinStudio-6.0.0.5106_f5dc54326cf880c90d092bea7f7388c05ee698bc

Now this issue is working fine. Application deploy successfully and hit the breakpoint.

Screencast for VS: http://www.screencast.com/t/I7ZC7O85r
Application Output: 
https://gist.github.com/Abhishekk360/2ff579c6e96e368ce6238d06a6c9c99a
Android Tool Log: https://gist.github.com/Abhishekk360/970e65bc7ad49fb091d364a659171df1

Screencast for Windows XS: http://www.screencast.com/t/H0PJurFAlzKB
Application Output: https://gist.github.com/Abhishekk360/841f5dcf072b73fafef457126a5183dc
Android Tool Log: https://gist.github.com/Abhishekk360/3af10195db1a64ebb9e92d32c42a5458

*********************
Mac Environment:
*********************

XamarinStudio-6.0.0.5111_9472333c01c545805d1fbe422d53925584a16aba
MonoFramework-MDK-4.4.0.150.macos10.xamarin.universal_54fa9c64b384cd91018a2dc285a454facfc9638a
xamarin.android-6.1.0-49_e2b60dbdeaa9e74f61a253650fe16c6afb1a27bc

Screencast: http://www.screencast.com/t/qZZymQTIpFoG
Application Output: https://gist.github.com/Abhishekk360/9ead480e79284809f57577f38883be65
Android Tool Log: https://gist.github.com/Abhishekk360/36abada2454531c45ff8a1ecf6f965db

Thanks!

Note You need to log in before you can comment on or make changes to this bug.