Bug 37435 - XA Sample app BuiltInView does not deploy until Fast Deployment Option is turned off and on again.
Summary: XA Sample app BuiltInView does not deploy until Fast Deployment Option is tur...
Status: NEEDINFO
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 6.0.0
Hardware: PC Windows
: Normal normal
Target Milestone: master
Assignee: dean.ellis
URL:
Depends on:
Blocks:
 
Reported: 2016-01-06 06:37 UTC by Jon Goldberger [MSFT]
Modified: 2017-06-29 18:13 UTC (History)
6 users (show)

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


Attachments
Logs (2.40 KB, application/zip)
2016-01-06 06:37 UTC, Jon Goldberger [MSFT]
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 for Bug 37435 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEEDINFO

Description Jon Goldberger [MSFT] 2016-01-06 06:37:07 UTC
Created attachment 14456 [details]
Logs

## Description

Loading the BuiltInView XA Sample app into Visual Studio 2015 and deploying to a simulator (Microsoft's Android simulator) the app does not deploy with the following message in the Debug Output pane:

>Android application is debugging.
>The application could not be started. Ensure that the application has been installed to the target device and has a launchable >activity (MainLauncher = true).
>
>Additionally, check Build->Configuration Manager to ensure this project is set to Deploy for this configuration.

However all of the above are OK, i.e. the project was set to deploy in the configuration manager and the MainLauncher is set. 

The first time I deployed the app, I assumed the debug connection was lost due to the amount of time it took to start the emulator on my VM because I got a message about the debugger losing the connection. So I deployed it again and got the message above. All subsequent attempts to deploy failed with the above message. 

So then I tried turning off the "Use Fast Deployment"  option and the app project then deployed and ran as expected. I was then able to turn that option back on and the app continued to deploy and launch as expected. 

Further testing showed that if I just turned off and back on the "use Fast Deployment" option before deploying the app project the very first time, the app project did deploy as expected. 

This leads me to suspect that there is something in the .csproj file that is changed when disabling that option that enables the app to deploy and launch. I diffed the two .csproj files and here are the changes after I first deselected the Fast Deployment option (the following lines were added):

>    <AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>
>    <AndroidLinkSkip />
>    <EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
>    <BundleAssemblies>False</BundleAssemblies>
>    <AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi>
>    <AndroidSupportedAbis />
>    <AndroidStoreUncompressedFileExtensions />
>    <MandroidI18n />
>    <Debugger>Xamarin</Debugger>
>    <AndroidEnableMultiDex>False</AndroidEnableMultiDex>
>    <DevInstrumentationEnabled>True</DevInstrumentationEnabled>

Reselecting the Fast Deployment option only changed the <EmbedAssembliesIntoApk> value back to "False". 

I realize that these are probably new keys that have been added or changed in XA projects since that sample was created, so this may just be a bug for the sample (assign accordingly if appropriate). However it seems to me that someone loading an old project might run into this issue and might be a bit disconcerted when it does not launch and the suggestions to fix are not relevant. De-selecting the Fast Deployment option is not an obvious solution so perhaps XA needs to supply proper default values for missing keys in the .csproj file, that or improve the error message. A customer ran into and reported the issue to the support team as they were unable to find a solution to make this sample app deploy as the message they got was not at all helpful. 


## Steps to reproduce

1. Download the sample from here:
http://developer.xamarin.com/samples/monodroid/BuiltInViews/

2. Run the BuiltInView app project to the Microsoft Android Emulator (tested on VS Emulator 7" Lollipop (5.1.1) XHDPI Tablet, but might occur on others as well)

3. When the debugger disconnects, run the project again. 

Expected result: App will be installed on simulator and will launch

Actual result: App is not installed or launched with the message noted above. 


## Log files

Attached


## Version info

Microsoft Visual Studio Professional 2015
Version 14.0.24720.00 Update 1
Microsoft .NET Framework
Version 4.6.01055

Installed Version: Professional

Visual Basic 2015   00322-40000-00000-AA850
Microsoft Visual Basic 2015

Visual C# 2015   00322-40000-00000-AA850
Microsoft Visual C# 2015

Visual C++ 2015   00322-40000-00000-AA850
Microsoft Visual C++ 2015

Visual F# 2015   00322-40000-00000-AA850
Microsoft Visual F# 2015

Windows Phone SDK 8.0 - ENU   00322-40000-00000-AA850
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 2015.1 (Beta8)   14.1.11106.0
ASP.NET and Web Tools 2015.1 (Beta8)

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

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

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

GitHub.VisualStudio   1.0
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

NuGet Package Manager   3.3.0
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   14.0.50616.0
Microsoft SQL Server Data Tools

TypeScript   1.7.4.0
TypeScript for Microsoft Visual Studio

Visual Studio Tools for Universal Windows Apps   14.0.24720.00
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

Xamarin   4.0.0.1717 (1390b70)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   6.0.0.35 (d300845)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   9.3.99.33 (ea30b32)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 1 Adam Hartley [MSFT] 2017-06-28 09:58:53 UTC
I was unable to reproduce this with Visual Studio 2017 as the sample app did not appear to build correctly and threw the error listed below when targeting the Visual Studio Android Emulator. 

1>------ Build started: Project: BuiltInViews, Configuration: Debug Any CPU ------
1>\\Mac\Home\Downloads\BuiltInViews\BuiltInViews\Properties\AndroidManifest.xml : warning XA0101: @(Content) build action is not supported
1>  BuiltInViews -> \\Mac\Home\Downloads\BuiltInViews\BuiltInViews\bin\Debug\BuiltInViews.dll
2>Starting deploy  5" Lollipop (5.1.1) XXHDPI Phone ...
2>Deploying  5" Lollipop (5.1.1) XXHDPI Phone ...
2>Build started.
2>Project "BuiltInViews.csproj" (Install target(s)):
2>C:\Program Files\Java\jdk1.8.0_112\\bin\keytool.exe -list -alias androiddebugkey -storepass android -keypass android -keystore "C:\Users\Adam\AppData\Local\Xamarin\Mono for Android\debug.keystore" 
2>C:\Program Files\Java\jdk1.8.0_112\\bin\jarsigner.exe -keystore "C:\Users\Adam\AppData\Local\Xamarin\Mono for Android\debug.keystore" -storepass android -keypass android -digestalg SHA1 -sigalg md5withRSA -signedjar bin\Debug\\com.xamarin.samples.builtinviews-Signed-Unaligned.apk \\Mac\Home\Downloads\BuiltInViews\BuiltInViews\obj\Debug\android\bin\com.xamarin.samples.builtinviews.apk androiddebugkey 
2>No -tsa or -tsacert is provided and this jar is not timestamped. Without a timestamp, users may not be able to validate this jar after the signer certificate's expiration date (2047-06-21) or after any future revocation date.
2>C:\Program Files (x86)\Android\android-sdk\build-tools\23.0.3\zipalign.exe 4 "\\Mac\Home\Downloads\BuiltInViews\BuiltInViews\bin\Debug\com.xamarin.samples.builtinviews-Signed-Unaligned.apk" "bin\Debug\\com.xamarin.samples.builtinviews-Signed.apk" 
2>Failure [INSTALL_FAILED_NO_MATCHING_ABIS]
2>Done building project "BuiltInViews.csproj".
2>Build succeeded.
2>An error occured. See full exception on logs for more details.
2>Failure [INSTALL_FAILED_NO_MATCHING_ABIS]
2>
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

Version Info:

Microsoft Visual Studio Enterprise 2017 
Version 15.2 (26430.13) Release
VisualStudio.15.Release/15.2.0+26430.13
Microsoft .NET Framework
Version 4.6.01586

Installed Version: Enterprise

Visual Basic 2017   00369-60000-00001-AA361
Microsoft Visual Basic 2017

Visual C# 2017   00369-60000-00001-AA361
Microsoft Visual C# 2017

Visual C++ 2017   00369-60000-00001-AA361
Microsoft Visual C++ 2017

Visual F# 4.1   00369-60000-00001-AA361
Microsoft Visual F# 4.1

Application Insights Tools for Visual Studio Package   8.6.00404.2
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2017   15.0.30503.0
ASP.NET and Web Tools 2017

ASP.NET Web Frameworks and Tools 2017   5.2.50303.0
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   15.0.30209.0
Azure App Service Tools v3.0.0

Azure Data Lake Node   1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio   2.2.5000.0
Microsoft Azure Data Lake Tools for Visual Studio

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

Fabric.DiagnosticEvents   1.0
Fabric Diagnostic Events

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

JavaScript UWP Project System   2.0
JavaScript UWP Project System

KofePackagePackage Extension   1.0
KofePackagePackage Visual Studio Extension Detailed Info

Merq   1.1.17-rc (cba4571)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.

Microsoft Azure Hive Query Language Service   2.2.5000.0
Language service for Hive query

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.50131.1

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio   Mono.Debugging.VisualStudio
Support for debugging Mono processes with Visual Studio.

Node.js Tools   1.3.50417.1
Adds support for developing and debugging Node.js apps in Visual Studio

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

SQL Server Data Tools   15.1.61702.140
Microsoft SQL Server Data Tools

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript   2.2.2.0
TypeScript tools for Visual Studio

Visual C++ for Linux Development   1.0.6
Visual C++ for Linux Development

Visual Studio Tools for Universal Windows Apps   15.0.26430.06
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

Xamarin   4.5.0.486 (fec6f88)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android SDK   7.3.1.2 (9dbc4c5)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK   10.10.0.37 (ad35de4)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Comment 2 Jon Goldberger [MSFT] 2017-06-29 18:13:08 UTC
@Adam,

That looks like the apk is not being built for the architecture of the emulator you are using.

> 2>Failure [INSTALL_FAILED_NO_MATCHING_ABIS]

Or at least that is usually what that failure means.