Bug 16748 - OsmDroidBindingExample causes "Device Unavailable" dialog when attempting to deploy from VS
Summary: OsmDroidBindingExample causes "Device Unavailable" dialog when attempting to ...
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Android ()
Version: 3.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Enzo Heredia
URL:
Depends on:
Blocks:
 
Reported: 2013-12-11 17:34 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2015-07-16 07:39 UTC (History)
10 users (show)

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


Attachments
Test case (386.81 KB, application/zip)
2013-12-11 17:34 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Details


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 FIXED

Description Brendan Zagaeski (Xamarin Team, assistant) 2013-12-11 17:34:34 UTC
Created attachment 5646 [details]
Test case

## Steps to reproduce

1. Close all Android emulators, and disconnect all Android devices.


2. In Visual Studio 2013, open the attached project. This is a trimmed-down version of the OsmDroidBindingExample that shows the problem. You can instead use the current full OsmDroidBindingExample from xamarin/monodroid-samples on GitHub, if you prefer.


3. Click the "green triangle" "Start" button on VS toolbar to build and deploy the solution to an Android emulator.


## Result

After the project has built, the "Device Unavailable" dialog appears, and the app cannot be deployed.


## Xamarin Studio result, also on Windows

The project successfully builds and deploys.


## Regression status

The behavior is the same in both the current beta Xamarin.Android 4.10.02005 and the stable Xamarin.Android 4.10.01073.


Tested on Windows 8.1 (64-bit)
Comment 1 rwakelan 2014-05-09 16:26:20 UTC
Has there been any update to this bug?  I am still experiencing it on my dev machine.
Comment 2 rwakelan 2014-05-15 10:28:38 UTC
Here is the version information for my dev setup:

Microsoft Visual Studio Professional 2013
Version 12.0.30110.00 Update 1
Microsoft .NET Framework
Version 4.5.50938

Installed Version: Professional

LightSwitch for Visual Studio 2013   06177-004-0447006-02051
Microsoft LightSwitch for Visual Studio 2013

Microsoft Office Developer Tools for Visual Studio 2013 ENU   06177-004-0447006-02051
Microsoft Office Developer Tools for Visual Studio 2013 ENU

Team Explorer for Visual Studio 2013   06177-004-0447006-02051
Microsoft Team Explorer for Visual Studio 2013

Visual Basic 2013   06177-004-0447006-02051
Microsoft Visual Basic 2013

Visual C# 2013   06177-004-0447006-02051
Microsoft Visual C# 2013

Visual C++ 2013   06177-004-0447006-02051
Microsoft Visual C++ 2013

Visual F# 2013   06177-004-0447006-02051
Microsoft Visual F# 2013

Visual Studio 2013 Code Analysis Spell Checker   06177-004-0447006-02051
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 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.0.11213.0
For additional information, visit http://www.asp.net/

Common Azure Tools   1.0
Provides common services for use by Azure Mobile Services and Windows Azure Tools.

Microsoft Web Developer Tools 2013   2.0.40926.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 Windows Azure Web Sites
Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Windows Azure

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

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

SQL Server Data Tools   12.0.30919.1
Microsoft SQL Server Data Tools

Windows Azure Mobile Services Tools   1.0
Windows Azure Mobile Services Tools

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

Xamarin for Visual Studio   1.12.278.0 (b3acb09afda91828e5bd48308ac8e7433d30f330)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android

Xamarin.Android   4.12.3.3 (7f0e3d3cfb9b36570e8d7862a33d0310238c814d)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   1.12.278.0 (b3acb09afda91828e5bd48308ac8e7433d30f330)
Visual Studio extension to enable development for Xamarin.iOS
Comment 3 Brendan Zagaeski (Xamarin Team, assistant) 2014-05-15 12:37:18 UTC
Hi @rwakelan, thanks for inspiring me to take a second at look at this with fresh eyes and more experience!


It turns out this problem is not specific to the OsmDroidBindingExample. It happens for all projects!


## Fix: enable "Deploy" in the Configuration Manager!


## "The problem is really just an imprecise error message"

At least on the current versions of Xamarin for Windows (1.12 and 2.0), the problem is simply that the error message doesn't give clear directions on how to fix the problem.

The error message should really be:
"Check Build -> Configuration Manager to ensure this project is set to Deploy for this configuration."


## Additional explanation

The problem is that the Xamarin Android VS extension only presents the "Check Build -> Configuration Manager ... Deploy ..." message if the target device is _already running_.

If you try to deploy to an emulator that isn't already in adb's devices list, then you get the less instructive "Device Unavailable" dialog.

Moreover, the VS extension only _starts_ the emulator if "Deploy" _is enabled_.



## Possible improvements

A. Change the error message for the problematic case (attempting to deploy to a non-running emulator when "Deploy" is _not enabled_) to add:

"Check Build -> Configuration Manager to ensure this project is set to Deploy for this configuration."


... or maybe instead or in addition:

B. Allow the VS extension to start Android emulators even if "Deploy" is _not enabled_.
Comment 4 rwakelan 2014-05-15 13:58:44 UTC
That fixed the error for me. I had chosen a different Platform while debugging a different issue. That platform didn't have Deploy set for the Android app.
Comment 5 narayanp 2015-07-16 07:34:58 UTC
I have checked this issue with latest stable XVS 3.11.666 and not getting this issue. Not getting "Device Unavailable" dialog when attempting to deploy from VS. Attached test case is deploying on Emulator(XAP) and device successfully.

Screencast:

As of now I am closing this issue, please feel free to reopen if you are experiencing this issue with latest XVS 3.11.666.
 
Environment info:
Microsoft Visual Studio Professional 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.5.51641

Installed Version: Professional

Xamarin   3.11.666.0 (ebae43a)
Xamarin.Android   5.1.4.16 (5f55a9ef61c11b6ce0890bc91e4c71b1b92be214)
Xamarin.iOS   8.10.2.0 (67b390d0d1bd741582cf7b7fd3ffea08583a3f83)
Comment 6 narayanp 2015-07-16 07:39:59 UTC
Here is the screencast: http://www.screencast.com/t/0cE08lgyK