Bug 20744 - Build fails with MSB6003 in Visual Studio: "aapt.exe" could not be run. The filename or extension is too long
Summary: Build fails with MSB6003 in Visual Studio: "aapt.exe" could not be run. The f...
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Android ()
Version: 3.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-06-19 23:49 UTC by Philipp
Modified: 2015-08-04 13:36 UTC (History)
5 users (show)

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


Attachments
solution to demonstrate + build log (2.32 MB, application/x-zip-compressed)
2014-06-19 23:49 UTC, Philipp
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:
RESOLVED NOT_REPRODUCIBLE

Description Philipp 2014-06-19 23:49:57 UTC
Created attachment 7126 [details]
solution to demonstrate + build log

I have a library bindings project which has an EmbeddedJar and several EmbeddedReferenceJar. Whenever I add this project to an application, I run into build problems:

error MSB6003: The specified task executable "aapt.exe" could not be run. The filename or extension is too long.

This bug is also described on http://forums.xamarin.com/discussion/14799/aapt-exe-bug by other users.

Steps to reproduce the problem:
1.) unzip the attachment to find a demo of this problem (extracted from my app available on keepass2android.codeplex.com)
2.) build the contained solution. This should work without errors
3.) make a whitespace change in Activity1.cs of the AaptProblemDemo project, build (no rebuild, only build)
4.) if the build succeeds, repeat 3.) until the build fails.
[Note: in my production app, this is not required to reproduce the problem. Maybe it depends on the file path length's, so this might even be required a few times. On my machine, the path is C:\Users\Philipp\Documents\keepass2android\repo\aaptproblemdemo, here I need to repeat step 3.) exactly once in the demo project.]
5.) Workaround: clean or rebuild the solution. In my production app, this leads to build times of > 2 minutes which is more or less unacceptable.

Note that in the attached .zip file, there is also a build log of my machine. One thing that seems wrong is that the "GetImportedLibraries-Task" is listing more than 500 (!) jars. But the bindings project only has 18 jars. (They are listed multiple times.)
Comment 1 Philipp 2014-06-19 23:54:33 UTC
BTW this bug existed in earlier versions as well. I waited for the latest updates to see if it is gone, but it isn't :-(
Comment 2 Sadik Ali 2014-06-20 03:01:37 UTC
I  have checked this issue but not able to reproduce it. I have  followed the same steps as mentioned in  above description. Also, I have attempt  step 3 around 50 times. I have made space changes in activity.cs page with different ways. But not reproduced. Here is screencast regarding same :
http://screencast.com/t/ZBdJW517P

Environment Info : 
=== Xamarin Studio ===

Version 5.0.1 (build 3)
Installation UUID: 1151d3d9-29c1-4339-b53c-a54856b47901
Runtime:
	Mono 3.4.0 ((no/c3fc3ba)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 304000204

=== Apple Developer Tools ===

Xcode 6.0 (6194.24)
Build 6A216f

=== Xamarin.iOS ===

Version: 7.9.0.272 (Enterprise Edition)
Hash: 0a0102c
Branch: 
Build date: 2014-06-18 22:16:24-0400

=== Xamarin.Android ===

Version: 4.12.4 (Enterprise Edition)
Android SDK: /Users/shruti/Desktop/android-sdk-macosx
	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)
Java SDK: /usr
java version "1.7.0_55"
Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)

=== Xamarin.Mac ===

Xamarin.Mac: Not Installed

=== Build Information ===

Release ID: 500010003
Git revision: f94ee866936d25105704eb63728ad5a981eda0a4
Build date: 2014-06-04 12:19:12-04
Xamarin addins: 1a6044e8321ea07e03a56b5381951686c82fed8b

=== Operating System ===

Mac OS X 10.9.3
Darwin Shrutis-Mac-mini.local 13.2.0 Darwin Kernel Version 13.2.0
    Thu Apr 17 23:03:13 PDT 2014
    root:xnu-2422.100.13~1/RELEASE_X86_64 x86_64

Please let me know If if missed anything to reproduce this issue.
Comment 3 Philipp 2014-06-22 00:53:28 UTC
I just tried in Xamarin Studio and can confirm it's working there. So this seems to be related to Visual Studio. Didn't expect the IDE to be relevant...
Comment 4 Sadik Ali 2014-06-25 05:58:35 UTC
This issue has been reproduced in Visual Studio. I have made space changes in Activity1.cs page at class creating location. I have given space after 'Activity :' and bug get reproduced.

Screencast : http://www.screencast.com/t/2rSmQGphzkQ

supplement Info : 
Warning Logs : https://gist.github.com/ShrutiSaini360/7a1da536ebb007db2a44
Build Output Log : https://gist.github.com/

Environment Info :
Microsoft Visual Studio Professional 2013
Version 12.0.21005.1 REL
Microsoft .NET Framework
Version 4.5.50938

Xamarin   3.0.54.0 (d3cf238e3845e930e312b6ec9b4c6c5437c33067)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android

Xamarin.Android   4.12.4.20 (b5dc5ce91305e19de51d71a1122c109719c4bc34)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   3.0.54.0 (d3cf238e3845e930e312b6ec9b4c6c5437c33067)
Visual Studio extension to enable development for Xamarin.iOS
Comment 5 marypablate 2014-07-12 05:29:59 UTC
Well, you can use LongPathTool, it works good.
Comment 6 Rajneesh Kumar 2015-07-17 07:20:11 UTC
Hi @Philipp, I have checked this issue with the latest stable build XVS
3.11.666 and observed that I am not able to reproduce this. 

Screencast:  http://www.screencast.com/t/4rY3Y2kDj

Could you please check this issue with the latest stable build XVS 3.11.666 and
let us know its working for you OR you are till getting same behavior ?

Thanks..!

Environment Info:

Microsoft Visual Studio Professional 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.5.50938
Installed Version: Professional
Xamarin   3.11.666.0 (ebae43a)
Visual Studio extension to enable development for Xamarin.iOS and
Xamarin.Android.
Xamarin.Android   5.1.4.16 (5f55a9ef61c11b6ce0890bc91e4c71b1b92be214)
Visual Studio plugin to enable development for Xamarin.Android.
Xamarin.iOS   8.10.2.0 (67b390d0d1bd741582cf7b7fd3ffea08583a3f83)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 7 Enzo Heredia 2015-08-04 13:36:27 UTC
can't reproduce in 4.0.0.804