Bug 44280 - Cannot build iOS project Error initializing task Delete: Not registered task Delete.
Summary: Cannot build iOS project Error initializing task Delete: Not registered task ...
Alias: None
Product: iOS
Classification: Xamarin
Component: MSBuild ()
Version: unspecified
Hardware: Macintosh Mac OS
: High critical
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2016-09-14 08:40 UTC by filipw
Modified: 2016-09-19 09:46 UTC (History)
5 users (show)

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

detailed build log (628.51 KB, application/zip)
2016-09-14 14:29 UTC, filipw

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:

Description filipw 2016-09-14 08:40:05 UTC
After installing XS 6.1 I cannot build iOS projects anymore.
Getting an error "Error initializing task Delete: Not registered task Delete."

Everything worked fine on 6.0.2. Tried uninstalling XS (using the clean up scripts) and reinstalling the entire toolchain and the error is still there.

Project "/Users/filip/Documents/dev/sonova/CoachApp/Source/eCoach/eCoach.UserInterface.iOS/eCoach.UserInterface.iOS.csproj" (Build target(s)):
	Target PrepareForBuild:
		Configuration: Debug Platform: iPhoneSimulator
	Target _DetectAppManifest:
		FindItemWithLogicalName Task
		  LogicalName: Info.plist
		  ProjectDir: /Users/filip/Documents/dev/sonova/CoachApp/Source/eCoach/eCoach.UserInterface.iOS
		  ResourcePrefix: Resources;Resources/AppIcons;Resources/Images;Resources/Images/General;Resources/Images/General/2x;Resources/Images/General/3x;Resources/Images/PairingWorkflow;Resources/Images/PairingWorkflow/2x;Resources/Images/PairingWorkflow/3x;Resources/Images/ProgramSelection;Resources/Images/ProgramSelection/2x;Resources/Images/ProgramSelection/3x;Resources/Images/RemoteControl;Resources/Images/RemoteControl/2x;Resources/Images/RemoteControl/3x;Resources/Images/Settings;Resources/Images/Settings/2x;Resources/Images/Settings/3x;Resources/Images/Settings/AccessoryConfiguration;Resources/Images/Settings/AccessoryConfiguration/2x;Resources/Images/Settings/AccessoryConfiguration/3x;Resources/Images/Help/AccessoryConnectivity;Resources/Images/Help/AccessoryConnectivity/2x;Resources/Images/Help/AccessoryConnectivity/3x;Resources/Images/Help/Instructions;Resources/Images/Help/Instructions/2x;Resources/Images/Help/Instructions/3x;Resources/Images/Introduction;Resources/Images/Introduction/2x;Resources/Images/Introduction/3x;
	Target _DetectSdkLocations:
		DetectSdkLocations Task
		  TargetFrameworkIdentifier: Xamarin.iOS
		  TargetArchitectures: i386
		  SdkVersion: 9.3
		  XamarinSdkRoot: /Library/Frameworks/Xamarin.iOS.framework/Versions/Current
		  SdkRoot: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk
		  SdkDevPath: /Applications/Xcode.app/Contents/Developer
		  SdkUsrPath: /Applications/Xcode.app/Contents/Developer/usr
		  SdkPlatform: iPhoneSimulator
		  SdkIsSimulator: True
	Target _BeforeCoreCompileInterfaceDefinitions:
: error : Error initializing task Delete: Not registered task Delete.
		Build FAILED.
		/Users/filip/Documents/dev/sonova/CoachApp/Source/eCoach/eCoach.UserInterface.iOS/eCoach.UserInterface.iOS.csproj (Build) ->
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets (_BeforeCoreCompileInterfaceDefinitions target) ->

			: error : Error initializing task Delete: Not registered task Delete.
			 0 Warning(s)
			 1 Error(s)
		Time Elapsed 00:00:00.1414950
Comment 1 Jason Imison 2016-09-14 09:00:04 UTC
Hi Filip,

Please could you post the versions of installed versions? You can find them at Xamarin Studio -> About -> Show Details
Comment 2 Jason Imison 2016-09-14 09:11:35 UTC
A diagnostic msbuild log would probably be useful too. You can switch this on via Xamarin Studio -> Preferences -> Project -> Build -> Log Verbosity
Comment 4 Lluis Sanchez 2016-09-14 10:21:47 UTC
Setting to NEEDINFO, since we need the diagnostic msbuild log.

Also, do you get the same error if you build from the command line using the xbuild command?
Comment 5 filipw 2016-09-14 14:19:01 UTC
Uninstalling 6.1.0 and going back to 6.0.2 (also downgraded Xamarin.iOS) resolved the issue for me.

I was able to reproduce it on another Mac though, through a fresh clone (so no obj/bin caching possible etc).

Here is the environment info:

Xamarin Studio Community
Version 6.1 (build 5441)
Installation UUID: ac88099a-9a83-40b8-8600-992137b1d20f
	Mono 4.6.0 (mono-4.6.0-branch/746756c) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 406000245


Nicht installiert

Apple Developer Tools
Xcode 7.3 (10183.3)
Build 7D175

Version: (Xamarin Studio Community)

Version: (Xamarin Studio Community)
Android SDK: Nicht gefunden

Xamarin Android Player
Nicht installiert

Version: (Xamarin Studio Community)
Hash: 6c3fee4
Branch: xcode8
Build date: 2016-09-09 13:01:32-0400

Build Information
Release ID: 601005441
Git revision: 68292d1ab289911c815ddc715dd7cc29a9752f9f
Build date: 2016-09-09 04:43:23-04
Xamarin addins: ed25d008672663eeb9db55f1ccecb3c24d2fd3b2
Build lane: monodevelop-lion-cycle8

Operating System
Mac OS X 10.11.3
Darwin TimsRetina.local 15.3.0 Darwin Kernel Version 15.3.0
    Thu Dec 10 18:40:58 PST 2015
    root:xnu-3248.30.4~1/RELEASE_X86_64 x86_64

I will get the build log as soon as I can.
Comment 6 filipw 2016-09-14 14:29:22 UTC
Created attachment 17461 [details]
detailed build log
Comment 7 Jason Imison 2016-09-14 14:41:55 UTC
The attachment is docx formatted for some reason. I converted it to text and uploaded here https://gist.githubusercontent.com/nosami/a58c2f1928715993897d62a4743a5343/raw/caf26813b3154c75647d0eb4215c0cd9e58b843c/msbuild.log
Comment 9 filipw 2016-09-15 14:02:07 UTC
Additional info: running the build from command line with xbuild, produces the same error, so it's not an Xamarin Studio bug.
Comment 10 Lluis Sanchez 2016-09-15 17:09:27 UTC
Comment 11 Jeffrey Stedfast 2016-09-15 19:35:17 UTC
This error suggests that this user's /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets  file does not contain the following line:

	<UsingTask TaskName="Microsoft.Build.Tasks.Delete" AssemblyFile="Xamarin.MacDev.Tasks.dll"/>

I don't know how that's possible because mine has it and I have Xamarin.iOS installed, just like what he has.
Comment 12 Jeffrey Stedfast 2016-09-15 19:35:58 UTC
I suggest reinstalling Xamarin.iOS
Comment 13 Flash3001 2016-09-16 18:29:58 UTC
filipw, I've just had the same issue. 

First I tried to set Xamarin Studio to use MSBuild in Preferences->Projects->Build.
It passed the error, but I had another one about not being able to AOT one DLL. 

I managed to fix it for me and I believe your error is my fault. 

I've done a binding for a Charts library and it is written using Swift, witch isn't support by Xamarin. 

To make it work I had to include some files (libraries) handling in MSBuild. 

By default it works pretty good in a Mac using Xamarin Studio, but if you use Visual Studio it just doesn't, because MS' Delete task doesn't sync the operations with your Build Host. So I had to include those lines in the .target file to make it work on VS:

<UsingTask TaskName="Microsoft.Build.Tasks.Copy" AssemblyFile="Xamarin.iOS.Tasks.dll"/>
<UsingTask TaskName="Microsoft.Build.Tasks.RemoveDir" AssemblyFile="Xamarin.iOS.Tasks.dll"/>
<UsingTask TaskName="Microsoft.Build.Tasks.Delete" AssemblyFile="Xamarin.iOS.Tasks.dll"/> 

I suppose the problem is the same because your file path shows your app's name 'eCoach' and I remember seeing the same name in a e-mail in an path I got from Claudio Greuter.

To fix it: Just open the file '/packages/Xamarin.SwiftSupport.' and remove the before mentioned lines. 

Meanwhile I'll try to figure it out and send an update to NuGet.
Comment 14 Flash3001 2016-09-16 18:32:37 UTC
*which isn't supported by Xamarin yet.
Comment 15 filipw 2016-09-19 09:46:40 UTC
@Flash3001 thanks a lot - this was totally it!

I made a smaller repro project (the original one was huuuuge) but it also contained the Xamarin.Swift22.Support package...

Thanks a lot for your help guys, closing it as it was not a Xamarin issue.