Bug 12938 - Can't Build after adding any Component
Summary: Can't Build after adding any Component
Status: VERIFIED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 4.8.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: 4.8 (async)
Assignee: Atsushi Eno
URL:
: 11759 12637 12959 13010 13087 13114 13226 13321 ()
Depends on:
Blocks:
 
Reported: 2013-06-28 09:50 UTC by Barranger Ridler
Modified: 2015-09-22 14:56 UTC (History)
17 users (show)

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


Attachments
The Project File (3.17 KB, application/octet-stream)
2013-06-28 10:42 UTC, Barranger Ridler
Details
The Entire project (458.80 KB, application/zip)
2013-06-28 10:54 UTC, Barranger Ridler
Details
Whole Project including everything (466.68 KB, application/zip)
2013-07-03 09:43 UTC, Barranger Ridler
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 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:
Status:
VERIFIED FIXED

Description Barranger Ridler 2013-06-28 09:50:59 UTC
I have an Android Project (in Xamarin Studio) that builds and runs perfectly until I add a component.  I've tried adding both Azure Mobile Services and Newtonsoft.Json.  In both cases after adding the component I get the following error (obviously the directories are dependant on which component has been added):

/Users/barranger/Projects/FirstTest/FirstTest: Error XA0000: Unexpected error - Please fill a bug report at http://bugzilla.xamarin.com. Reason: System.IO.DirectoryNotFoundException: Directory '/Users/barranger/Projects/FirstTest/FirstTest/obj/Debug/__library_projects__/Newtonsoft.Json/library_project_imports' not found. (XA0000) (FirstTest)

Any help would be greatly appreciated.

I'll add the build output here just for completeness:

Cleaning Solution: FirstTest (Debug)

Cleaning: FirstTest (Debug)

Build started 28/06/2013 9:44:07 AM.
__________________________________________________
Project "/Users/barranger/Projects/FirstTest/FirstTest/FirstTest.csproj" (Clean target(s)):
	
	Target _CleanMonoAndroidIntermediateDir:
		  RemovedDirectories: 
		    obj/Debug/res
		  RemovedDirectories: 
		    obj/Debug/__library_projects__
Done building project "/Users/barranger/Projects/FirstTest/FirstTest/FirstTest.csproj".

Build succeeded.
	 0 Warning(s)
	 0 Error(s)

Time Elapsed 00:00:00.0842770

Building Solution: FirstTest (Debug)

Building: FirstTest (Debug)

Build started 28/06/2013 9:44:07 AM.
__________________________________________________
Project "/Users/barranger/Projects/FirstTest/FirstTest/FirstTest.csproj" (Build target(s)):
	
	Target _CheckProjectItems:
		CheckProjectItems Task
		  NativeLibraries:
		  JavaLibraries:
		  JavaSourceFiles:
	
	Target _ComputeAndroidAssetsPaths:
		  ResourceFiles:
		  IntermediateFiles:
	
	Target _GenerateAndroidAssetsDir:
	No output files were specified for target _GenerateAndroidAssetsDir, skipping.
	
	Target _ComputeAndroidResourcePaths:
		  ResourceFiles:
		    Resources/layout/Main.axml
		    Resources/values/Strings.xml
		    Resources/drawable/icon.png
		  IntermediateFiles:
		Created directory "obj/Debug/res/"
	
	Target _GenerateAndroidResourceDir:
		Creating directory '/Users/barranger/Projects/FirstTest/FirstTest/obj/Debug/res/layout'
		Copying file from '/Users/barranger/Projects/FirstTest/FirstTest/Resources/layout/Main.axml' to '/Users/barranger/Projects/FirstTest/FirstTest/obj/Debug/res/layout/main.xml'
		Creating directory '/Users/barranger/Projects/FirstTest/FirstTest/obj/Debug/res/values'
		Copying file from '/Users/barranger/Projects/FirstTest/FirstTest/Resources/values/Strings.xml' to '/Users/barranger/Projects/FirstTest/FirstTest/obj/Debug/res/values/strings.xml'
		Creating directory '/Users/barranger/Projects/FirstTest/FirstTest/obj/Debug/res/drawable'
		Copying file from '/Users/barranger/Projects/FirstTest/FirstTest/Resources/drawable/icon.png' to '/Users/barranger/Projects/FirstTest/FirstTest/obj/Debug/res/drawable/icon.png'
	
	Target _ResolveMonoAndroidSdks:
		MonoAndroid Tools: /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mandroid/
		MonoAndroid Framework: /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mandroid/platforms/android-8;/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1
		MonoAndroid Binaries: /Library/Frameworks/Xamarin.Android.framework/Versions/Current/bin/
		Android NDK: /
		Android SDK: /Users/barranger/Library/Developer/Xamarin/android-sdk-mac_x86/
		Android SDK Build Tools: /Users/barranger/Library/Developer/Xamarin/android-sdk-mac_x86/build-tools/17.0.0/
		Java SDK: /usr/
	
	Target _ValidateAndroidPackageProperties:
		GetAndroidPackageName Task
		  ManifestFile: /Users/barranger/Projects/FirstTest/FirstTest/Properties/AndroidManifest.xml
		  AssemblyName: FirstTest
		  PackageName: FirstTest.FirstTest
	
	Target _BuildDependencies:
		Resolved library outputs: 
	
	Target _ExtractLibraryProjectImports:
		  Assemblies: 
		    /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1/System.dll
		    /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1/System.Xml.dll
		    /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mandroid/platforms/android-8/Mono.Android.dll
		    ../Components/json.net-4.5.11/lib/android/Newtonsoft.Json.dll
		    /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/mono/2.1/System.Core.dll
:  monodroiderror XA0000: Unexpected error - Please fill a bug report at http://bugzilla.xamarin.com. Reason: System.IO.DirectoryNotFoundException: Directory '/Users/barranger/Projects/FirstTest/FirstTest/obj/Debug/__library_projects__/Newtonsoft.Json/library_project_imports' not found.
		  Jars: 
		  ResolvedResourceDirectories: 
	Task "ResolveLibraryProjectImports" execution -- FAILED
	Done building target "_ExtractLibraryProjectImports" in project "/Users/barranger/Projects/FirstTest/FirstTest/FirstTest.csproj".-- FAILED
	
Done building project "/Users/barranger/Projects/FirstTest/FirstTest/FirstTest.csproj".-- FAILED

Build FAILED.
Errors:

/Users/barranger/Projects/FirstTest/FirstTest/FirstTest.csproj (Build) ->
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets (_ExtractLibraryProjectImports target) ->

	:  monodroiderror XA0000: Unexpected error - Please fill a bug report at http://bugzilla.xamarin.com. Reason: System.IO.DirectoryNotFoundException: Directory '/Users/barranger/Projects/FirstTest/FirstTest/obj/Debug/__library_projects__/Newtonsoft.Json/library_project_imports' not found.

	 0 Warning(s)
	 1 Error(s)

Time Elapsed 00:00:00.1150740

---------------------- Done ----------------------

Build: 1 error, 0 warnings
Comment 1 Jonathan Pryor 2013-06-28 10:37:26 UTC
Please attach a project which exhibits the issue.

By any chance, have you changed $(IntermediateOutputPath)?
Comment 2 Barranger Ridler 2013-06-28 10:42:12 UTC
Created attachment 4224 [details]
The Project File
Comment 3 Barranger Ridler 2013-06-28 10:42:48 UTC
I didn't change $(IntermediateOutputPath) that I know of
Comment 4 Jonathan Pryor 2013-06-28 10:51:16 UTC
Not just the .csproj, the entire project, please. :-)
Comment 5 Barranger Ridler 2013-06-28 10:54:58 UTC
Created attachment 4225 [details]
The Entire project

I did remove the obj/Debug folder to get it to be under 8 MB
Comment 6 Jonathan Pryor 2013-06-28 12:37:28 UTC
Which version of Xamarin.Android do you see this on? Your project builds fine for me on 4.7.11 (current Alpha).

What is odd is that my build doesn't have the `FirstTest/FirstTest/obj/Debug/__library_projects__/Newtonsoft.Json/library_project_imports` directory, which your build is complaining about, so perhaps this was fixed?
Comment 7 Barranger Ridler 2013-06-28 13:40:22 UTC
I'm currently set to Beta, but will now try Alpha.

As for versions:

=== Xamarin Studio ===

Version 4.0.9 (build 12)
Installation UUID: a89f6523-bdc9-430d-949c-ae3c084f138d
Runtime:
	Mono 3.0.12 ((no/d6c5db8)
	GTK 2.24.18
	GTK# (2.12.0.0)
	Package version: 300120000

=== Apple Developer Tools ===

Xcode 4.6.3 (2068)
Build 4H1503

=== Xamarin.iOS ===

Version: 6.3.6.77 (Starter Edition)
Hash: fa63be7
Branch: 
Build date: 2013-17-06 20:54:24-0400

=== Xamarin.Android ===

Version: 4.7.9 (Starter Edition)
Android SDK: /Users/barranger/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.1   (API level 16)
		4.2   (API level 17)
Java SDK: /usr
java version "1.6.0_51"
Java(TM) SE Runtime Environment (build 1.6.0_51-b11-456-11M4508)
Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-456, mixed mode)

=== Xamarin.Mac ===

Xamarin.Mac: Not Installed

=== Build Information ===

Release ID: 400090012
Git revision: f9c5c24e88417feb0319953db6d5fc650d416608
Build date: 2013-06-21 17:34:16+0000
Xamarin addins: 898d8afaabb160c025e21656f1490fa149397bff

=== Operating System ===

Mac OS X 10.8.4
Darwin Barrangers-MacBook-Pro.local 12.4.0 Darwin Kernel Version 12.4.0
    Wed May  1 17:57:12 PDT 2013
    root:xnu-2050.24.15~1/RELEASE_X86_64 x86_64
Comment 8 Barranger Ridler 2013-06-28 13:47:12 UTC
Nope moving to Alpha causes the same issue.  Here's the new versions:

=== Xamarin Studio ===

Version 4.1.4 (build 117)
Installation UUID: a89f6523-bdc9-430d-949c-ae3c084f138d
Runtime:
	Mono 3.0.12 ((no/d6c5db8)
	GTK 2.24.18
	GTK# (2.12.0.0)
	Package version: 300120000

=== Apple Developer Tools ===

Xcode 4.6.3 (2068)
Build 4H1503

=== Xamarin.Mac ===

Xamarin.Mac: Not Installed

=== Xamarin.iOS ===

Version: 6.3.6.77 (Starter Edition)
Hash: fa63be7
Branch: 
Build date: 2013-17-06 20:54:24-0400

=== Xamarin.Android ===

Version: 4.7.11 (Starter Edition)
Android SDK: /Users/barranger/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.1   (API level 16)
		4.2   (API level 17)
Java SDK: /usr
java version "1.6.0_51"
Java(TM) SE Runtime Environment (build 1.6.0_51-b11-456-11M4508)
Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-456, mixed mode)

=== Build Information ===

Release ID: 401040117
Git revision: e0f38912731e43ed9d3f1a410dd4fd907e7f1ba0
Build date: 2013-06-11 19:29:58+0000
Xamarin addins: 8fd84026361c1969794b85bee48efab97a5f33b3

=== Operating System ===

Mac OS X 10.8.4
Darwin Barrangers-MacBook-Pro.local 12.4.0 Darwin Kernel Version 12.4.0
    Wed May  1 17:57:12 PDT 2013
    root:xnu-2050.24.15~1/RELEASE_X86_64 x86_64
Comment 10 Jonathan Pryor 2013-06-28 14:01:38 UTC
Does it work if you build from Terminal.app (i.e. is this caused by Xamarin Studio?)?

    $ cd /Users/barranger/Projects/FirstTest
    $ xbuild
    $ cd FirstTest
    $ xbuild /t:Install
Comment 11 Barranger Ridler 2013-06-28 14:05:37 UTC
Unfortunately I don't have a business license so I get:

XBuild Engine Version 3.0.12.0
Mono, Version 3.0.12.0
Copyright (C) Marek Sieradzki 2005-2008, Novell 2008-2011.

Build started 28/06/2013 2:04:36 PM.
__________________________________________________
Project "/Users/barranger/Projects/FirstTest/FirstTest.sln" (default target(s)):
	Target ValidateSolutionConfiguration:
		Building solution configuration "Debug|Any CPU".
	Target Build:
		Project "/Users/barranger/Projects/FirstTest/FirstTest/FirstTest.csproj" (default target(s)):
			Target _CheckProjectItems:
				CheckProjectItems Task
				  NativeLibraries:
				  JavaLibraries:
				  JavaSourceFiles:
			Target _ComputeAndroidAssetsPaths:
				  ResourceFiles:
				  IntermediateFiles:
			Target _GenerateAndroidAssetsDir:
			No output files were specified for target _GenerateAndroidAssetsDir, skipping.
			Target _ComputeAndroidResourcePaths:
				  ResourceFiles:
				    Resources/layout/Main.axml
				    Resources/values/Strings.xml
				    Resources/drawable/icon.png
				  IntermediateFiles:
			Target _GenerateAndroidResourceDir:
			Skipping target "_GenerateAndroidResourceDir" because its outputs are up-to-date.
			Target _ResolveMonoAndroidSdks:
: error XA9008: Building from the command-line requires a Business License.
			Task "ResolveSdks" execution -- FAILED
			Done building target "_ResolveMonoAndroidSdks" in project "/Users/barranger/Projects/FirstTest/FirstTest/FirstTest.csproj".-- FAILED
		Done building project "/Users/barranger/Projects/FirstTest/FirstTest/FirstTest.csproj".-- FAILED
	Task "MSBuild" execution -- FAILED
	Done building target "Build" in project "/Users/barranger/Projects/FirstTest/FirstTest.sln".-- FAILED
Done building project "/Users/barranger/Projects/FirstTest/FirstTest.sln".-- FAILED

Build FAILED.
Errors:

/Users/barranger/Projects/FirstTest/FirstTest.sln (default targets) ->
(Build target) ->
/Users/barranger/Projects/FirstTest/FirstTest/FirstTest.csproj (default targets) ->
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets (_ResolveMonoAndroidSdks target) ->

	: error XA9008: Building from the command-line requires a Business License.

	 0 Warning(s)
	 1 Error(s)

Time Elapsed 00:00:00.9463050
Comment 12 Atsushi Eno 2013-07-02 04:51:12 UTC
I couldn't reproduce the build failure either, with almost exactly the same versions as comment #8 (Xcode is 4.5.2 but we don't use it for XA). __library_projects__ subdirectory is not created, which is the expected behavior after some XA 4.7.x version.

I guess deleting intermediate "obj" directory ended up to clean the issue away. Could you try removing "obj" and "bin" under the project directory? 4.7.11 contains additional clean logic that might have improved the situation better. The repro archive didn't contain anything under bin and obj, which could be the reason  for the different results.
Comment 13 Atsushi Eno 2013-07-02 05:08:55 UTC
*** Bug 12959 has been marked as a duplicate of this bug. ***
Comment 14 Barranger Ridler 2013-07-02 10:25:48 UTC
Just tried removing those directories but I still get the same error message
Comment 15 Atsushi Eno 2013-07-02 12:17:11 UTC
Hmm, could you attach your project again but this time _with obj directory_, so that I might be able to find what's going on there? I'm sorry for inconvenience.
Comment 16 etiennebp 2013-07-02 13:55:22 UTC
I'm getting this error also on a freshly created Android project. As soon as I add a reference to a .dll it won't build. No obj/bin folders are even created.

My (other) project used to work just fine until I activated an Indie license.
Comment 17 Barranger Ridler 2013-07-03 09:43:49 UTC
Created attachment 4265 [details]
Whole Project including everything
Comment 18 Atsushi Eno 2013-07-03 16:00:29 UTC
Thanks, unfortunately that matched one of my attempts to reproduce that obj/Debug/* state, so the cause of the issue is something I never thought of...
Comment 19 Atsushi Eno 2013-07-04 07:51:28 UTC
Finally I could reproduce the bug, only with JSON.NET so far, not any.

Here's my build ouitput:
https://gist.github.com/atsushieno/5f58c05520a30cf7d063
Comment 20 Barranger Ridler 2013-07-04 09:44:15 UTC
The other one I had this problem with was the Azure Mobile Services, however I'm not 100% sure that it doesn't use JSON.NET under the covers
Comment 21 Atsushi Eno 2013-07-04 13:08:50 UTC
Thanks Barranger, that helped my investigation. It turned out that I can reproduce on both components when I am using Starter license.
Comment 22 juan.villa 2013-07-06 18:48:40 UTC
I am also having this issue. I'm on a Mac running the latest beta version as of this posting (Xamarin 4.0.9, Android 4.7.11). I have tired all suggestions with no luck.
Comment 23 Stephen Shaw 2013-07-08 11:35:23 UTC
I just noticed this issue. For whatever reason it wouldn't completely build my solution because of this error. I realized that my license was still saying starter edition. I opened one of the prebuilt apps and built that. As I was building it it complained about needed a non starter license and finally connected with xamarin to verify my licenses. Once it had done that, I reopened my solution and it built just fine.
Comment 24 Jonathan Pryor 2013-07-10 17:29:40 UTC
Fixed in master/16246dc1 and monodroid-4.8.0-branch/0bd5f1a0.
Comment 25 Jonathan Pryor 2013-07-10 17:32:44 UTC
*** Bug 13114 has been marked as a duplicate of this bug. ***
Comment 26 Jonathan Pryor 2013-07-10 18:12:07 UTC
*** Bug 13087 has been marked as a duplicate of this bug. ***
Comment 27 Jonathan Pryor 2013-07-11 15:34:15 UTC
*** Bug 13010 has been marked as a duplicate of this bug. ***
Comment 28 narayanp 2013-07-15 06:18:48 UTC
Today I have checked this issue with following builds:

X.S 4.0.10
Mono 3.1.1-2
Xamarin.Android 4.8.0-4

And to check this issue I have build the attached project "Whole Project including everything" also created one android application and added Json.NET Component in this project and  build this project, I am successfully able to build the project.

Changing the status to Verified.
Comment 29 Bernhard Glück 2013-11-07 01:35:13 UTC
We have the same issue (  Error XA0000: Unexpected error , directory library_project_imports not found ).

Is there any resolution for this or any version of Xamarin.Android that fixes this ? 

(We are currently using the newest alpha channel release, because of VS2013 support )
Comment 30 narayanp 2013-11-07 02:01:27 UTC
Today I have checked this issue with following builds:

All Windows
VS 2013/2012/2010
X.Android 4.10.1-52

I am not able to reproduce it on VS, It is working fine for me. I have built that attached project"Whole Project including everything" as well as created a new android app and added Json.net component and build it, It builds successfully for me.

@Bernhard, could you please let me know which component you are adding for which you are getting build error?
Comment 31 Bernhard Glück 2013-11-07 12:00:19 UTC
We are getting it for a referenced java binding library project ( TestFlight SDK ) 
It also only happens on our Build Server, not on our dev machines. 
The build server runs TeamCity and Xamarin.Android Business Edition.
Comment 32 Jonathan Pryor 2013-11-15 16:06:22 UTC
@Bernhard: Which Xamarin.Android version does your build server run? Has it been updated?

Furthermore, the original bug would only happen when using Starter edition. Are you sure you have a license on your build server?
Comment 33 juli 2013-11-18 17:59:16 UTC
We are having this same issue for a referenced java binding library project (Singly SDK).

I only happens on Windows. On Mac works perfectly.

Issue:

C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2,2): Error XA0000: Unexpected error - Please file a bug report athttp://bugzilla.xamarin.com. Reason: System.IO.DirectoryNotFoundException: Could not find a part of the path "{path}\Murally.Android\obj\Debug\__library_projects__\SinglyAndroidSDK\library_project_imports\SinglyAndroidResources\bin\classes\com\singly\android\client\AuthenticationActivity$AuthenticationWebChromeClient.class" (XA0000) (Murally.Android)

Versions:

Xamarin Studio
Version 4.2.1 (build 1)
Installation UUID: 30866470-afb8-411d-a069-5497fcc64c15
Runtime:
	Microsoft .NET 4.0.30319.18051
	GTK+ 2.24.20 theme: MS-Windows
	GTK# (2.12.0.0)

Xamarin.Android
Version: 4.8.3 (Indie Edition)
Android SDK: C:\Users\Daniela\AppData\Local\Android\android-sdk
	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.2   (API level 17)
Java SDK: C:\Program Files (x86)\Java\jdk1.6.0_39
java version "1.6.0_39"
Java(TM) SE Runtime Environment (build 1.6.0_39-b04)
Java HotSpot(TM) Client VM (build 20.14-b01, mixed mode, sharing)

Build Information
Release ID: 402010001
844a84fe0aa0cb5f986d4e3c4807a51487d07845
Build date: 2013-11-13 16:45:15Z
Xamarin addins: 97e44e4863da6c479427794457637e75b3d22600

Operating System
Windows 6.2.9200.0 (64-bit)
Comment 34 Jonathan Pryor 2014-01-10 16:38:48 UTC
*** Bug 11759 has been marked as a duplicate of this bug. ***
Comment 35 Anonymous 2014-05-12 05:41:58 UTC
This appears to be related to the length of the path.

I've experienced this myself when the path was 263 characters long.  After I created a symlink to the project directory on D:\ (making the path shorter), the error went away. Simply moving the project directory would've probably worked as well.
Comment 36 Jonathan Pryor 2014-07-28 18:18:39 UTC
*** Bug 13321 has been marked as a duplicate of this bug. ***
Comment 37 Jonathan Pryor 2014-12-18 16:49:40 UTC
*** Bug 13226 has been marked as a duplicate of this bug. ***
Comment 38 Jonathan Pryor 2015-09-22 14:56:37 UTC
*** Bug 12637 has been marked as a duplicate of this bug. ***