Bug 18495 - Component manager does not completely install components
Summary: Component manager does not completely install components
Status: RESOLVED ANSWERED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Android ()
Version: 1.10.x
Hardware: PC Windows
: --- normal
Target Milestone: Future Cycle
Assignee: dean.ellis
URL:
Depends on:
Blocks:
 
Reported: 2014-03-20 12:17 UTC by Yvan Rodrigues
Modified: 2017-08-07 07:04 UTC (History)
15 users (show)

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


Attachments
screenshot of file that "doesn't exist" (44.08 KB, image/png)
2014-03-20 17:10 UTC, Yvan Rodrigues
Details
Adding a component to a new project. (77.79 KB, image/png)
2014-03-21 14:05 UTC, Yvan Rodrigues
Details
Unresolved component (76.67 KB, image/png)
2014-03-21 14:06 UTC, Yvan Rodrigues
Details
The project in the state left after attempting to add a component. (36.67 KB, application/x-zip-compressed)
2014-03-21 14:16 UTC, Yvan Rodrigues
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 ANSWERED

Description Yvan Rodrigues 2014-03-20 12:17:30 UTC
VERSION INFORMATION AT BOTTOM.
I've had this happen to me twice today, so hopefully someone else can reproduce it.

The first time I added the Android Support v4 component to an existing project. When I compiled, it was missing the whole Components\xamandroidsupportv4-18-4.19.0.1\lib\android\19.0.1\content\support\v4 directory.

I tried again, and this time there was a zip file in 'content', so I manually installed 'support'. There weren't any error messages that I could see.

Now I just tried to install the Nokia HERE Maps (Google Maps v2 API Compatibility) 1.1.1 component, and there are missing bits again. I opened the sample project and when I compile I get the error:

Unexpected error - Please file a bug report at http://bugzilla.xamarin.com. Reason: System.IO.DirectoryNotFoundException: Could not find a part of the path "[redacted]\Components\NokiaHEREGoogleMapsV2-1.1.1\samples\GoogleMapsV2Demo\GoogleMapsV2Demo\obj\Debug\__library_projects__\Nokia.HERE.GoogleMapsV2\library_project_imports\Nokia.Here.GoogleMapsApi.Jars.reference_v2_lib.jar"

It is correct. The directory at Components\NokiaHEREGoogleMapsV2-1.1.1\samples\GoogleMapsV2Demo\GoogleMapsV2Demo\obj\Debug\__library_projects__ is empty.

Microsoft Visual Studio Ultimate 2012
Version 11.0.61030.00 Update 4
Microsoft .NET Framework
Version 4.5.51641

Installed Version: Ultimate

Visual C# 2012   04940-004-0038003-02632
Microsoft Visual C# 2012

Xamarin.Android   4.12.02001 (a1e3982a)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   1.10.47 (3d6a125d)
Visual Studio extension to enable development for Xamarin.iOS
Comment 1 Yvan Rodrigues 2014-03-20 12:29:49 UTC
AHA!

When I went back to Edit Components I see the error:

Error downloading component. The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

When I copied the sample project to c:\temp it worked fine.

From http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx:


Maximum Path Length Limitation

In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters. A local path is structured in the following order: drive letter, colon, backslash, name components separated by backslashes, and a terminating null character. For example, the maximum path on drive D is "D:\some 256-character path string<NUL>" where "<NUL>" represents the invisible terminating null character for the current system codepage. (The characters < > are used here for visual clarity and cannot be part of a valid path string.)

Note  File I/O functions in the Windows API convert "/" to "\" as part of converting the name to an NT-style name, except when using the "\\?\" prefix as detailed in the following sections.

The Windows API has many functions that also have Unicode versions to permit an extended-length path for a maximum total path length of 32,767 characters. This type of path is composed of components separated by backslashes, each up to the value returned in the lpMaximumComponentLength parameter of the GetVolumeInformation function (this value is commonly 255 characters). To specify an extended-length path, use the "\\?\" prefix. For example, "\\?\D:\very long path".
Comment 2 Yvan Rodrigues 2014-03-20 16:32:21 UTC
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(166,2): error XA5209: Unzipping failed. Please download https://dl-ssl.google.com/android/repository/google_play_services_4242030_r15.zip and extract it to the [REDACTED]\Components\googleplayservicesgingerbread-15.0.2\lib\android\15\content directory.
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(166,2): error XA5209: Reason: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(166,2): error XA5206: . Android resource directory [REDACTED]\Components\googleplayservicesgingerbread-15.0.2\lib\android\15\content\google-play-services/libproject/google-play-services_lib doesn't exist.
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(166,2): error XA5209: Unzipping failed. Please download https://dl-ssl.google.com/android/repository/google_play_services_4242030_r15.zip and extract it to the [REDACTED]\Components\googleplayservicesgingerbread-15.0.2\lib\android\15\content directory.
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(166,2): error XA5209: Reason: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(166,2): error XA5207: . Java library file [REDACTED]\Components\googleplayservicesgingerbread-15.0.2\lib\android\15\content\google-play-services/libproject/google-play-services_lib/libs/google-play-services.jar doesn't exist.
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(166,2): error XA5209: Unzipping failed. Please download https://dl-ssl.google.com/android/repository/support_r19.0.1.zip and extract it to the [REDACTED]\Components\googleplayservicesgingerbread-15.0.2\lib\android\19.0.1\content directory.
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(166,2): error XA5209: Reason: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(166,2): error XA5206: Please install package: 'Android Support Library' available in SDK installer. Android resource directory [REDACTED]\Components\googleplayservicesgingerbread-15.0.2\lib\android\19.0.1\content\support/v7/appcompat doesn't exist.
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(166,2): error XA5209: Unzipping failed. Please download https://dl-ssl.google.com/android/repository/support_r19.0.1.zip and extract it to the [REDACTED]\Components\googleplayservicesgingerbread-15.0.2\lib\android\19.0.1\content directory.
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(166,2): error XA5209: Reason: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(166,2): error XA5207: Please install package: 'Android Support Library' available in SDK installer. Java library file [REDACTED]\Components\googleplayservicesgingerbread-15.0.2\lib\android\19.0.1\content\support/v7/appcompat/libs/android-support-v7-appcompat.jar doesn't exist.
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(166,2): error XA5209: Unzipping failed. Please download https://dl-ssl.google.com/android/repository/support_r19.0.1.zip and extract it to the [REDACTED]\Components\googleplayservicesgingerbread-15.0.2\lib\android\19.0.1\content directory.
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(166,2): error XA5209: Reason: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(166,2): error XA5206: Please install package: 'Android Support Library' available in SDK installer. Android resource directory [REDACTED]\Components\googleplayservicesgingerbread-15.0.2\lib\android\19.0.1\content\support/v7/mediarouter doesn't exist.
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(166,2): error XA5209: Unzipping failed. Please download https://dl-ssl.google.com/android/repository/support_r19.0.1.zip and extract it to the [REDACTED]\Components\googleplayservicesgingerbread-15.0.2\lib\android\19.0.1\content directory.
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(166,2): error XA5209: Reason: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(166,2): error XA5207: Please install package: 'Android Support Library' available in SDK installer. Java library file [REDACTED]\Components\googleplayservicesgingerbread-15.0.2\lib\android\19.0.1\content\support/v7/mediarouter/libs/android-support-v7-mediarouter.jar doesn't exist.
Comment 3 Yvan Rodrigues 2014-03-20 16:48:00 UTC
Hope this can be fixed, but as a workaround I installed Link Shell Extension (http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html) and created a symbolic link linking C:\shortpath\ to B:\looooooooooooooooooongpath\.
Comment 4 Yvan Rodrigues 2014-03-20 16:52:34 UTC
Actually, that didn't work either. The path was STILL too long, even after I chopped it to ~20 characters. Since the embedded paths in these zips are so long, I think this needs fixing before it is very usable.
Comment 5 Yvan Rodrigues 2014-03-20 17:09:32 UTC
OK now it's just lying :(

C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(166,2): error XA5206: . Android resource directory [REDACTED]\Components\googleplayservicesgingerbread-15.0.2\lib\android\15\content\google-play-services/libproject/google-play-services_lib doesn't exist.
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(166,2): error XA5207: . Java library file [REDACTED]\Components\googleplayservicesgingerbread-15.0.2\lib\android\15\content\google-play-services/libproject/google-play-services_lib/libs/google-play-services.jar doesn't exist.
Comment 6 Yvan Rodrigues 2014-03-20 17:10:29 UTC
Created attachment 6369 [details]
screenshot of file that "doesn't exist"
Comment 7 Sadik Ali 2014-03-21 07:15:30 UTC
I have checked this issue and able to reproduce. I noticed that for a long path project component have not downloaded.

Steps:

1. create a sample android application and put into long path upto 250n character.
2. Add Components in created project. 

Refer screen shot: http://screencast.com/t/htWxQiRct9

Build Info:

Window
VS 2012, 2013
XA 4.12.02001
Comment 8 Yvan Rodrigues 2014-03-21 11:27:43 UTC
I split comment #5/6 into its own issue #18510, as it is not directly related to the installation process of components, but rather compilation using components.
Comment 9 Yvan Rodrigues 2014-03-21 14:04:46 UTC
I'm not sure if this is the same issue or not, but it was easy to reproduce.

Open Visual Studio 2012.
New Project: Android Application
Components | Get more components
Select Google Play Services (Gingerbread), Add.

The browser window goes to an error page (see screen shot "add-component.png"
The result is "unresolved-component.png"
Comment 10 Yvan Rodrigues 2014-03-21 14:05:17 UTC
Created attachment 6380 [details]
Adding a component to a new project.
Comment 11 Yvan Rodrigues 2014-03-21 14:06:11 UTC
Created attachment 6381 [details]
Unresolved component
Comment 12 Yvan Rodrigues 2014-03-21 14:07:26 UTC
FYI the path for the project in comment #9 is "short":
C:\Users\Yvan\Documents\visual studio 2012\Projects\AndroidApplication1
Comment 13 Yvan Rodrigues 2014-03-21 14:16:43 UTC
Created attachment 6382 [details]
The project in the state left after attempting to add a component.
Comment 14 Yvan Rodrigues 2014-03-21 14:18:12 UTC
Tested trying to add a different component (Google Analytics) with same results.
Comment 15 julias4 2014-12-25 12:35:39 UTC
Did you try Long Path Tool that is also useful in situations where you see these error messages.
Comment 16 Rainer Mager 2015-03-28 02:19:17 UTC
I'm also having this issue. Does anyone have a fix or workaround?
Comment 17 Kent Green [MSFT] 2015-07-17 17:53:35 UTC
As described here, this appears to be caused by a limitation on Windows due to the enforced path length limitations:
> In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters.
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath

A general workaround in this case is to move your files closer to the root drive, thus shortening the path.
Comment 18 Jeremy Kolb 2016-04-07 17:59:15 UTC
Seeing the same problem.
Comment 19 riona 2016-06-20 11:55:30 UTC
I used Long Path Tool for this problem and It resolved
Comment 20 Prashant [MSFT] 2017-08-07 07:04:07 UTC
As it mentioned in comment #17, it is recommended to move your files closer to the root drive. I am marking this bug as resolved answered, please reopen it if you continue to have any issues