Bug 42136 - Android app (in Forms solution) build fails with error "directory not empty"
Summary: Android app (in Forms solution) build fails with error "directory not empty"
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 7.1 (C9)
Hardware: PC Windows
: Normal normal
Target Milestone: master
Assignee: dean.ellis
Depends on:
Reported: 2016-06-23 23:02 UTC by Jon Goldberger [MSFT]
Modified: 2017-06-23 20:44 UTC (History)
9 users (show)

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

Xam Logs (12.58 KB, application/zip)
2016-06-23 23:02 UTC, Jon Goldberger [MSFT]

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 or GitHub 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:

Description Jon Goldberger [MSFT] 2016-06-23 23:02:24 UTC
Created attachment 16468 [details]
Xam Logs

## Description

This error was thrown from Xamarin.Android.Comon.targets. It occurred after I uninstalled VS 2015 pro and installed VS 2015 Enterprise. The app was a simple Forms app from template with two pages added with only one button on each page, so very basic. 

I was able to resolve the issue based on this forum post:

IOW I added a JDK_HOME the Windows 10 environment variables pointing to the Java SDK folder. 

I know this might be an edge case but wanted to report it so it is on record. 

Log files attached.

## Environment

Microsoft Visual Studio Enterprise 2015
Version 14.0.25123.00 Update 2
Microsoft .NET Framework
Version 4.6.01038

Installed Version: Enterprise

Architecture and Modeling Tools   00322-80000-00000-AA208
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.

Visual Basic 2015   00322-80000-00000-AA208
Microsoft Visual Basic 2015

Visual C# 2015   00322-80000-00000-AA208
Microsoft Visual C# 2015

Visual C++ 2015   00322-80000-00000-AA208
Microsoft Visual C++ 2015

Visual F# 2015   00322-80000-00000-AA208
Microsoft Visual F# 2015

Windows Phone SDK 8.0 - ENU   00322-80000-00000-AA208
Windows Phone SDK 8.0 - ENU

ASP.NET and Web Tools 2015 (RC1 Update 1)   14.1.20203.0
ASP.NET and Web Tools 2015 (RC1 Update 1)

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.40314.0
For additional information, visit http://www.asp.net/

Azure App Service Tools v2.9   14.0.20316.0
Azure App Service Tools v2.9

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.0.6000.0
Microsoft Azure Data Lake Tools for Visual Studio

Common Azure Tools   1.7
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.

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

Microsoft Azure HDInsight HQL Service   2.0.6000.0
Language service for Hive query

Microsoft Azure HDInsight Tools for Visual Studio   2.0.6000.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.9
Microsoft Azure Tools for Microsoft Visual Studio 2015 - v2.9.40323.3

NuGet Package Manager   3.4.4
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.60311.1
Microsoft SQL Server Data Tools

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript tools for Visual Studio

Visual Studio Tools for Universal Windows Apps   14.0.25219.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.

VsPackage Extension   1.0
VsPackage Visual Studio Extension Detailed Info

Xamarin (34a92cd)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android (7db2aac)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS (3cf8aae)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 1 Jon Goldberger [MSFT] 2016-06-24 01:54:34 UTC
OK, so just had this happen again with another new Forms project and this time deleting all of the bin and obj folders resolved the issue. Just cleaning, however, did not.
Comment 2 dean.ellis 2016-11-24 14:49:24 UTC

We kinda need diagnostic build output to diagnose this issue. The Logs provided do not contain any diagnostic build data.

It will help use see which target is failing.
Comment 3 Daniel Cazzulino 2016-11-24 15:08:41 UTC
Looks like a targets issue. 

If files are locked, it might also be related to the Android designer.
Comment 4 Dominique Louis 2016-11-24 15:50:58 UTC
Can  I also suggest this be retested with C9 and latest Xamarin.Forms to confirm it is still happening, as quite a few under the hood changes have taken place since June.
Comment 5 Jon Goldberger [MSFT] 2016-11-28 21:11:14 UTC
I removed the JDK_HOME environment variable I had set and tried to reproduce the issue with the Cycle 9 builds (alpha channel). I am not able to reproduce the issue now.
Comment 6 dean.ellis 2016-12-13 15:14:11 UTC
Moving to C10 and lowering priority since its not reproducable atm.
If someone can repo, we need the diagnostic build output if possible.
Comment 7 John Miller [MSFT] 2017-06-23 20:44:14 UTC
Resolving this since we’re unable to reproduce this report. If anyone does manage to reproduce this please reopen and attach a diagnostic build log: