Bug 24148 - Popup asking for Xamarin.Android license when only building an iOS project and XA project is unloaded.
Summary: Popup asking for Xamarin.Android license when only building an iOS project an...
Status: RESOLVED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: General ()
Version: 3.7
Hardware: PC Windows
: Normal normal
Target Milestone: 4.0.1 (C6SR1)
Assignee: Jatin
URL:
Depends on:
Blocks:
 
Reported: 2014-10-29 22:18 UTC by Jon Goldberger [MSFT]
Modified: 2015-10-15 14:15 UTC (History)
9 users (show)

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

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:
RESOLVED FIXED

Description Jon Goldberger [MSFT] 2014-10-29 22:18:43 UTC
This seems similar to bugs 22834 and 23307 but it's happening when an Android project is in the solution but unloaded. You can build and deploy a WinPhone or iOS project but the popup comes up every time you build. 

## Steps to reproduce.

1. Disconnect from the internet on your windows machine. 
2. Open windows file explorer and delete the Xamarin.Android license file from %PROGRAMDATA%\Mono for Android
3. Load a sample XForms project (or other X-Platform project that includes a XA project) and, after killing the popup, unload the Android project.
4. Build and deploy the WinPhone project (or the iOS project if you can still connect to your build host)

# Expected result: Winphone app will build and deploy without being warned about Xamarin Android license requirements

# Actual result: WinPhone app builds and deploys but popup appears saying that a Xamarin Android license is required still pops up. 

## Note: It might seem that the build failed at first glance, but it doesn't. 

## Version information:

Microsoft Visual Studio Ultimate 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.51641

Installed Version: Ultimate

Architecture and Modeling Tools   06181-004-0451031-02209
Microsoft Architecture and Modeling Tools
    
UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

LightSwitch for Visual Studio 2013   06181-004-0451031-02209
Microsoft LightSwitch for Visual Studio 2013

Team Explorer for Visual Studio 2013   06181-004-0451031-02209
Microsoft Team Explorer for Visual Studio 2013

Visual Basic 2013   06181-004-0451031-02209
Microsoft Visual Basic 2013

Visual C# 2013   06181-004-0451031-02209
Microsoft Visual C# 2013

Visual C++ 2013   06181-004-0451031-02209
Microsoft Visual C++ 2013

Visual F# 2013   06181-004-0451031-02209
Microsoft Visual F# 2013

Visual Studio 2013 Code Analysis Spell Checker   06181-004-0451031-02209
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.

Windows Phone SDK 8.0 - ENU   06181-004-0451031-02209
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package   1.0
Application Insights Tools for Visual Studio

ASP.NET and Web Tools   12.3.50717.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 Websites
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.20703.0
For additional information, visit http://www.asp.net/

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

Microsoft Advertising SDK for Windows Phone   
Microsoft Advertising SDK for Windows Phone
Build 

Microsoft Azure Mobile Services Tools   1.2
Microsoft Azure Mobile Services Tools

Microsoft Azure Tools   2.4
Microsoft Azure Tools for Microsoft Visual Studio 2013 - v2.4.20730.1601

NuGet Package Manager   2.8.50313.46
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

PowerShell Tools   1.2
Provides file classification services using PowerShell

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

SAPReferenceManager   1.0
Manages References to Shared Projects

SQL Server Data Tools   12.0.40706.0
Microsoft SQL Server Data Tools

Windows Azure Tools   2.3
Windows Azure Tools for Microsoft Visual Studio 2013 - v2.3.20320.1602

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.7.230.0 (e78d10d6993f95fc3ebe791aeb4aacff165bf8bb)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   4.18.0.39 (0ef616ae42005ece52f6df7aa1e093ceb11998f8)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   8.4.0.0 (209abebbd8f1a292d042420edb45fa5fbd3f017b)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 2 Jatin 2014-10-30 04:18:08 UTC
I am successfully able to reproduce this issue at my end with the latest build using the steps mentioned in the bug.

Here is the screencast for the same: http://www.screencast.com/t/l8NMH5z2

Build information:

=== Xamarin Studio ===

Version 5.5.3 (build 6)
Installation UUID: 522f0c5e-80a3-4414-aec7-1f3b9c1768d1
Runtime:
	Microsoft .NET 4.0.30319.18408
	GTK+ 2.24.22 (MS-Windows theme)
	GTK# 2.12.25

=== Xamarin.Android ===

Version: 4.18.1 (Business Edition)
Android SDK: C:\Users\Admin\AppData\Local\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)
		3.2    (API level 13)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		4.5    (API level 21)
Java SDK: C:\Program Files\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)

=== Build Information ===

Release ID: 505030006
Git revision: fbe3e9453daf6a3bb9a9709ed22bec35f7c9056b
Build date: 2014-10-23 13:11:11-04
Xamarin addins: e44add2b39de4dd57c0742bb2e620dfad84c64c6

=== Operating System ===

Windows 6.1.7601.65536
Comment 3 Brendan Zagaeski (Xamarin Team, assistant) 2014-10-30 13:50:28 UTC
Regression status: sort-of a regression

## Old behavior

Xamarin   3.5.58.0 (6b70b1e28c5a733187f7659220da4c0ff61ab2b1)

In Xamarin 3.5.58, the Xamarin.Android project will be automatically unloaded after the activation dialog is displayed and dismissed. Once the project is unloaded, no further dialogs will appear when cleaning, building, deploying, or debugging other projects.


## New behavior

Xamarin   3.6.262.0 (21b7dba8736246dfd10e3f19a92ed68f1b30abfd)
Xamarin.Android   4.16.0.17 (2a7b68212b17c903160fbd8e0106babb299d1be3)
Xamarin.iOS   8.0.66.0 (3e201c8aa14879773f966f483329bcda49fd3a41)

Xamarin   3.7.248.0 (8ca7d11db8a6f874c6cd2de6d9ca0f511867ce91)
Xamarin.Android   4.18.1.3 (5474129af31e9d3a86cb7482c7c5c7a30ad315f1)
Xamarin.iOS   8.4.0.0 (209abebbd8f1a292d042420edb45fa5fbd3f017b)


In the end, the new behavior is not really too different from the old behavior. The main change is that now you are allowed to keep the Xamarin.Android project open even when in the unlicensed state.

### Workaround

You can prevent the Xamarin.Android activation dialog from appearing when building other projects:

1. Manually unload the Xamarin.Android project
2. Quit Visual Studio.
3. Reopen the solution in Visual Studio.


Even though the workaround is fairly easy, this would still be a nice bug to fix, if possible. The build system is not interacting directly with the Xamarin.Android project when building the Windows Phone project, so from a user's perspective it's confusing that the activation dialog for Android appears.



Thanks!
Comment 4 Brendan Zagaeski (Xamarin Team, assistant) 2014-10-31 13:25:48 UTC
Just one quick additional comment since a customer pointed out that my previous comment might be a little ambiguous:

The ideal fix would be to keep the new behavior (allow loading Xamarin projects when you don't have a license), but also allow building non-Xamarin projects in the same solution without unloading the Xamarin projects. If that's not possible, then perhaps it would be possible to make it so unloading the Xamarin.Android project (without restarting VS) is sufficient.

A little further explanation: once you've loaded a Xamarin.Android project in the unlicensed state, you will get an activation dialog when building _any_ project in _any_ solution, even if the solution does not contain any Xamarin projects. You will need to quit and restart Visual Studio to stop the problem. 

Xamarin.iOS projects loaded in the unlicensed state do not cause this same persistent problem. It seems the Xamarin.Android VS extension does not unload itself in the same way as the Xamarin.iOS extension.