2
votes

On Visual studio for mac 2019, the default watchOS breaks on build with the error below. The phone-app project only builds successfully before adding the WatchOS project from VS project template.

Help please.

ERROR /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(4,4): Error MSB4094: "/Users/devpc/Projects/SampleWatchApp/Watch/Watch.WatchOSExtension/bin/iPhoneSimulator/Debug/WatchWatchOSExtension.appex;/Users/devpc/Projects/SampleWatchApp/Watch/Watch.WatchOSExtension/bin/iPhoneSimulator/Debug/WatchWatchOSExtension.appex" is an invalid value for the "Source" parameter of the "Ditto" task. Multiple items cannot be passed into a parameter of type "Microsoft.Build.Framework.ITaskItem". (MSB4094) (Watch.WatchOSApp)

1
Have you tried running one of the watch samples github.com/xamarin/ios-samples/tree/master/watchOS/… to see if it is a project config error? - Iain Smith
Can you try delete bin and obj folder, then rebuild your project to check if it works. - Jack Hua
Deleting the folders has not effect. You should know also that i did not edit the default code from the template. I just created and built and ...error - waletoye
@IainSmith the WatchConnectivity Sample worked. But why will the default project from VS for mac 2019 template not work? - waletoye

1 Answers

4
votes

I realized that VS for mac 2019 for some reason adds double references for the Watch-Extension project.

Removing one reference solves the problem.

enter image description here