Bug 18510 - Android resource directory/Java library does not exist
Summary: Android resource directory/Java library does not exist
Status: CONFIRMED
Alias: None
Product: Android
Classification: Xamarin
Component: Bindings ()
Version: 4.12.0
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Radek Doulik
URL:
Depends on:
Blocks:
 
Reported: 2014-03-21 11:24 UTC by Yvan Rodrigues
Modified: 2014-12-03 07:41 UTC (History)
4 users (show)

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


Attachments
Xamarin Studio indicates that files required to build are missing. (99.86 KB, image/png)
2014-03-21 12:52 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 for Bug 18510 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:
CONFIRMED

Description Yvan Rodrigues 2014-03-21 11:24:51 UTC
After a Xamarin component is added to a project using "Get more components", the path to the component and the jar file cannot be found by the build process.

I can reproduce this in Visual Studio 2012 and Xamarin Studio on OSX. Here are the errors from both platforms:

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.

: 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.
: 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.


In both cases the paths are valid and do exist.
Comment 1 Yvan Rodrigues 2014-03-21 11:29:18 UTC
Visual Studio versions:
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

Xamarin Studio Mac versions:
Xamarin Studio
Version 4.2.3 (build 60)
Installation UUID: c36bc290-85ed-4457-badc-fc1f06ee4ae7
Runtime:
	Mono 3.2.6 ((no/9b58377)
	GTK+ 2.24.23 theme: Raleigh
	GTK# (2.12.0.0)
	Package version: 302060000

Apple Developer Tools
Xcode 5.1 (5084)
Build 5B130a

Xamarin.iOS
Version: 7.2.0.2 (Business Edition)
Hash: 58c3efa
Branch: 
Build date: 2014-10-03 18:02:26-0400

Xamarin.Android
Version: 4.12.1 (Business Edition)
Android SDK: /Users/yvan/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.4   (API level 19)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

Build Information
Release ID: 402030060
Git revision: 30c4afc300c2a39ec5300851357ce02e49dd217e
Build date: 2014-03-05 22:09:33+0000
Xamarin addins: f8a9589b57c2bfab2ccd73c880e7ad81e3ecf044

Operating System
Mac OS X 10.9.2
Darwin fluffy.local 13.1.0 Darwin Kernel Version 13.1.0
    Thu Jan 16 19:40:37 PST 2014
    root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64
Comment 3 Atsushi Eno 2014-03-21 12:05:48 UTC
rodo: any idea on this google play services resource issue?
Comment 4 Yvan Rodrigues 2014-03-21 12:08:22 UTC
I created a fresh test project in the same root directory as the one above; added the Google Play Services (Gingerbread) component.

It builds successfully.
Comment 5 Yvan Rodrigues 2014-03-21 12:14:06 UTC
Just for fun, I got this when trying to remove a component while testing this issue:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Cannot get libraries from incompatible component
  at Xamarin.Components.Ide.Component.GetLibrariesWithStatus () [0x00073] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.2.3-branch/30c4afc3/source/md-addins/Xamarin.Ide/Xamarin.Components.Ide/Components/Component.cs:221 
  at Xamarin.Components.Ide.Component.ProjectHasAnyReferences () [0x00002] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.2.3-branch/30c4afc3/source/md-addins/Xamarin.Ide/Xamarin.Components.Ide/Components/Component.cs:505 
  at Xamarin.Components.Ide.Component.AskAndRemoveFromProject (Xwt.WindowFrame parentWindow) [0x00024] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.2.3-branch/30c4afc3/source/md-addins/Xamarin.Ide/Xamarin.Components.Ide/Components/Component.cs:230 
  at Xamarin.Ide.Components.ComponentReferenceCommandHandler.DeleteItem () [0x00022] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.2.3-branch/30c4afc3/source/md-addins/Xamarin.Ide/Xamarin.Ide/Xamarin.Ide.Components/ComponentReferenceCommands.cs:132 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00054] in /private/tmp/source/bockbuild-mono-3.2.6/profiles/mono-mac-xamarin/build-root/mono-3.2.6/mcs/class/corlib/System.Reflection/MonoMethod.cs:230 
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00069] in /private/tmp/source/bockbuild-mono-3.2.6/profiles/mono-mac-xamarin/build-root/mono-3.2.6/mcs/class/corlib/System.Reflection/MonoMethod.cs:238 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /private/tmp/source/bockbuild-mono-3.2.6/profiles/mono-mac-xamarin/build-root/mono-3.2.6/mcs/class/corlib/System.Reflection/MethodBase.cs:114 
  at MonoDevelop.Components.Commands.DefaultCommandHandler.Run (System.Object target, MonoDevelop.Components.Commands.Command cmd) [0x00019] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.2.3-branch/30c4afc3/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:2094 
  at MonoDevelop.Components.Commands.CustomCommandTargetAttribute.Run (System.Object target, MonoDevelop.Components.Commands.Command cmd) [0x00009] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.2.3-branch/30c4afc3/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CustomCommandTargetAttribute.cs:101 
  at MonoDevelop.Ide.Gui.Components.NodeCommandHandler+TransactedNodeHandlerAttribute.Run (System.Object target, MonoDevelop.Components.Commands.Command cmd) [0x0002d] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.2.3-branch/30c4afc3/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/NodeCommandHandler.cs:296 
  at MonoDevelop.Components.Commands.CustomCommandTargetAttribute.MonoDevelop.Components.Commands.ICommandTargetHandler.Run (System.Object target, MonoDevelop.Components.Commands.Command cmd) [0x00004] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.2.3-branch/30c4afc3/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CustomCommandTargetAttribute.cs:58 
  at MonoDevelop.Components.Commands.CommandHandlerInfo.Run (System.Object cmdTarget, MonoDevelop.Components.Commands.Command cmd) [0x00021] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.2.3-branch/30c4afc3/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:1963 
  at MonoDevelop.Components.Commands.CommandManager+<DispatchCommand>c__AnonStorey2.<>m__1 () [0x0005f] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.2.3-branch/30c4afc3/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:1054 
  at MonoDevelop.Components.Commands.CommandManager.DispatchCommand (System.Object commandId, System.Object dataItem, System.Object initialTarget, CommandSource source) [0x002b0] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-4.2.3-branch/30c4afc3/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:1071
Comment 6 Yvan Rodrigues 2014-03-21 12:51:43 UTC
Back to the Mac.

I removed the components from the projects. Then I deleted every trace of the components at the filesystem level. I re-added the components. The solution successfully built.

Something else is being weird (see red references in screenshot), but at least it built.
Comment 7 Yvan Rodrigues 2014-03-21 12:52:39 UTC
Created attachment 6379 [details]
Xamarin Studio indicates that files required to build are missing.
Comment 8 Shruti 2014-03-24 07:09:32 UTC
The issue has been reproduced with following steps.

1. Create a new Android Test project.
2. Add component 'Google Play Services(Gingerbread)' from 'Add more Components'.
3. Build the project.Project will not compile successfully and will generate errors.
4. Error log shows that '.jar' file is missing and it is also asking to download google_play_services_4242030.zip file and extract on location where project resides. 
5. I downloaded 'google_play_services_4242030.zip' file and try to extract as per given path but failed to extract due to long path issue

It seems that this is long path issue when component is downloaded and takes long path to extract the files then it fails to download because it does not allow to take the path more than 259 characters.


Reference Error Log : 
https://gist.github.com/Mohit-Kheterpal/d863a272d9f32512e62e

Environment Info :
Visual Studio 2012.
XS : 4.2.3 (build 60)
X.Android : Version: 4.12.2
Comment 9 David Laundav 2014-12-03 07:41:53 UTC
I get the exact same issue as Shruti which, as seen from the date information, seemingly has existed since March this year. 

When is it expected to be fixed? It is a blocker for me personally, since I cannot continue development.

Environment info:
Visual Studio 2013: v12.0.30723.00 (Update 3)
Xamarin: v3.7.248
Xamarin.Android: v4.18.1.3