Bug 52574 - XamarinBuildDownloadDir property is not set
Summary: XamarinBuildDownloadDir property is not set
Status: RESOLVED DUPLICATE of bug 45321
Alias: None
Product: Components
Classification: Xamarin
Component: Xamarin Components ()
Version: N/A
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Israel Soto [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2017-02-16 16:26 UTC by Mark Silver
Modified: 2017-02-24 22:01 UTC (History)
4 users (show)

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

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:
RESOLVED DUPLICATE of bug 45321

Description Mark Silver 2017-02-16 16:26:20 UTC
Getting this error in my Xamarin.iOS project, both in the current alpha channel xamarin build and beta channel.

Xamarin Studio Community
Version 6.2 (build 1812)

Xamarin.iOS
Version: 10.4.0.121 (Xamarin Studio Community)
Hash: 9d6e1ab
Branch: cycle9
Build date: 2017-02-10 12:10:51-0500


I have absolutely no idea how to debug it and no idea what might be causing it.

Here's the relevant target from the Xamarin.Build.Download.targets file:

	<Target Name="_XamarinBuildDownloadCore">
		<Error Text="XamarinBuildDownloadDir property is not set" Condition="'$(XamarinBuildDownloadDir)'==''" />
		<XamarinDownloadArchives
			Archives="@(XamarinBuildDownload)"
			DestinationBase="$(XamarinBuildDownloadDir)"
			CacheDirectory="$(XamarinBuildDownloadCacheDir)"
			/>
	</Target>

I tried setting the log verbosity for MSBuild to diagnostic or detailed, but the build output doesn't really show anything useful.

Target _XamarinBuildDownloadCore:
    /Users/marksilver/.nuget/packages/xamarin.build.download/0.2.2/build/Xamarin.Build.Download.targets(24,3): error : XamarinBuildDownloadDir property is not set
Done building target "_XamarinBuildDownloadCore" in project "SaltApp.iOS.csproj" -- FAILED.


Any ideas?
Comment 1 Mark Silver 2017-02-16 16:28:08 UTC
Another potentially useful bit of information from the build output:

Target ResolveAssemblyReferences:
    /Library/Frameworks/Mono.framework/Versions/4.8.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(1972,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed.
Done building target "ResolveAssemblyReferences" in project "SaltApp.iOS.csproj".
Comment 2 Mark Silver 2017-02-16 17:40:11 UTC
So I've managed to get rid of the error by removing the Xamarin Google Tag Manager iOS nuget

Xamarin.Google.iOS.TagManager (v5.0.8)

I've seen other posts indicating the same thing for other GoogleApis components.

I'm fairly certain this error is related somehow to the nugets for https://github.com/xamarin/GoogleApisForiOSComponents/
Comment 3 Jeffrey Stedfast 2017-02-17 14:34:19 UTC
@Bill,

Where's the proper location to file this?
Comment 4 Bill Holmes 2017-02-21 21:02:22 UTC
This belongs with the Components team.  I will take it.
Comment 5 Bill Holmes 2017-02-21 21:16:39 UTC
In general you should not have to set 'XamarinBuildDownloadDir.'  The code should be able to assign a default.  

You may want to try and update Xamarin Build Download to a newer version.

https://www.nuget.org/packages/Xamarin.Build.Download/

0.4.2 is the latest version.  I think it does not have this check and it may reveal the real error.

fyi there is an open pull request that releases the source for Xamarin Build Download.
https://github.com/xamarin/XamarinComponents/tree/xamarin.build.download/Util/Xamarin.Build.Download

You can try to manually set the XamarinBuildDownloadDir in your csproj.  You will have to edit the csproj in a text editor.  

You will have to add a line in the top property group.  Here for example...

https://github.com/xamarin/GoogleApisForiOSComponents/blob/master/Google.Analytics/samples/CuteAnimalsiOS/CuteAnimalsiOS/CuteAnimalsiOS.csproj#L14

Assigning to Israel as he has some other ideas.
Comment 6 Mark Silver 2017-02-22 09:13:10 UTC
I haven't tried to set it or alter it in any way, nor am I using the Xamarin.Build.Download nuget in my project anywhere.

I assume it comes in with the Google Tag Manager iOS bindings nuget. Hopefully Israel knows what it might be.
Comment 7 Mark Silver 2017-02-22 09:23:07 UTC
I can see Xamarin.Build.Download (v0.2.2) is a dependency of that nuget here https://www.nuget.org/packages/Xamarin.Google.iOS.TagManager/

So either there's a reason it needs to use the older version or it hasn't been updated. 

Cheers.
Comment 8 Mark Silver 2017-02-22 12:34:30 UTC
I added this line to the csproj file.
	<XamarinBuildDownloadDir>\Users\marksilver\.nuget\packages\xamarin.build.download\0.2.2\build\</XamarinBuildDownloadDir>

Seems to work, not 100% if that's the right directory, but it will have to do for now.
Comment 9 Bill Holmes 2017-02-22 18:00:46 UTC
Xamarin Build Download is not something that you reference in your code.  It only provides build tasks that download additional Google 'bits' to add to your application.

The dependency version has not been updated in NuGet yet because we have not released a new Tag Manager.  0.2.2 should work just fine.  Not sure yet why 0.2.2 does not work for you.  The later versions (0.3+) of Xamarin Build Download were mainly focused for dealing with Android binding projects such as Android Support and Google Play.  But in doing that work we changed the logic for where files are downloaded to.  I am thinking if you update to the latest you will not need to set that property.  

Israel did find another issue with the files being downloaded.  (It may actually have nothing to do with your situation.)  There is a typo in the targets file for the ID of the dependency being downloaded.  

https://github.com/xamarin/GoogleApisForiOSComponents/search?utf8=%E2%9C%93&q=_GoogleSymbolUtilitiesItemsFolder

However if you are satisfied with setting the property or updating and you can build you app I suggest we close this bug.  

Israel and Matt please respond with your thoughts.
Comment 10 Mark Silver 2017-02-23 09:34:28 UTC
I gathered that thanks Bill.

I don't think I'm able to update to the latest, my project is using project.json with nuget v3.x. I don't believe you can see the dependencies in the packages list.

All I know is as soon as I have added the latest version of nuget for Xamarin.Google.iOS.TagManager to my project. I get the bug when I build, last time I tried I was able to get the project to build in debug, but then I changed to release and it reappeared.

I don't see the point in closing the bug when it's obviously still present and may cause issues for other users.
Comment 11 Bill Holmes 2017-02-24 15:36:13 UTC
Mark,

My point was that if you could update to the latest and it resolved the issue, then there is no action for this bug.  Or we would update TagManager, and others, to point to the later version of Xamarin build download.

It was not my intention to be dismissive of your situation.  Apologies if that was the impression I gave.  

Moving forward...  You may have just provided the critical bit of info I was missing (or I just overlooked previously.)  The use of project.json.  We will dig deeper into this.

For clarity, it appears that you have a working workaround.  Setting XamarinBuildDownloadDir.  Can you confirm that you are no longer blocked (although inconvenienced?)
Comment 12 Mark Silver 2017-02-24 15:47:47 UTC
Yes no longer blocked, thank you.

And thanks for taking the time for looking in to this. Much appreciated.
Comment 13 Bill Holmes 2017-02-24 22:00:33 UTC
Mark,

After a slack discussion I found that using project json is the issue.  There is a bug in the system that appears to be fixed now in source but will take some time to propagate to the product.  To be honest I am not sure of the timeline. 

https://bugzilla.xamarin.com/show_bug.cgi?id=45321

We believe this bug causes the targets file to be added to your project but not the props file that is contained in the NuGet.  The props file is what would typically be setting up the default XamarinBuildDownloadDir property.  This supports why setting the property manually in your situation works.  

https://github.com/xamarin/XamarinComponents/blob/xamarin.build.download/Util/Xamarin.Build.Download/source/Xamarin.Build.Download/Xamarin.Build.Download.props#L8-L9

For this reason I will be resolving this defect as a duplicate of 45321.  Please comment again if you feel there is a better appropriate action.

Additionally we technically do not support this mode of operation officially.  Xamarin.Android and Xamarin.iOS projects should not be using project.json.  We recommend that you change your projects to use csproj and packages.config.  It could save you future headaches.
Comment 14 Bill Holmes 2017-02-24 22:01:13 UTC

*** This bug has been marked as a duplicate of bug 45321 ***