weixin_39744384
weixin_39744384
2021-01-03 21:03

NU1201 - WatchOSApp is not compatible with xamarinios10

Steps to Reproduce

  1. Migrate a packages.config iOS project to use PackageReferences
  2. Keep the WatchOS project reference as it was:
xml
<projectreference include="..\bla\bla.WatchOSApp\bla.WatchOSApp.csproj">
      <project>{5e26a76d-a2ef-465d-81e2-9bf3943395d4}</project>
      <name>bla.WatchOSApp</name>
      <isappextension>false</isappextension>
      <iswatchapp>true</iswatchapp>
      <referenceoutputassembly>false</referenceoutputassembly>
</projectreference>

Expected Behavior

No errors

Actual Behavior

NU1201 - Project bla.WatchOSApp is not compatible with xamarinios10 (Xamarin.iOS,Version=v1.0) / win-x86. Project bla.WatchOSApp supports: xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0) bla.iOS

Environment

Microsoft Visual Studio Enterprise 2019 Version 16.0.0 VisualStudio.16.Release/16.0.0+28729.10 Microsoft .NET Framework Version 4.7.03190

Installed Version: Enterprise

Visual C++ 2019 00435-60000-00000-AA861 Microsoft Visual C++ 2019

ADL Tools Service Provider 1.0 This package contains services used by Data Lake tools

Application Insights Tools for Visual Studio Package 9.0.20307.1 Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2019 16.0.12311.10635 ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2019 16.0.12311.10635 For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0 16.0.12311.10635 Azure App Service Tools v3.0.0

Azure Data Lake Node 1.0 This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio 2.3.7000.2 Microsoft Azure Data Lake Tools for Visual Studio

Azure Functions and Web Jobs Tools 16.0.12311.10635 Azure Functions and Web Jobs Tools

Azure Stream Analytics Tools for Visual Studio 2.3.7000.2 Microsoft Azure Stream Analytics Tools for Visual Studio

C# Tools 3.0.0-beta4-19170-01+1deafee3682da88bf07d1c18521a99f47446cee8 C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Extensibility Message Bus 1.1.77 (master) Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

Fabric.DiagnosticEvents 1.0 Fabric Diagnostic Events

Microsoft Azure HDInsight Azure Node 2.3.7000.2 HDInsight Node under Azure Node

Microsoft Azure Hive Query Language Service 2.3.7000.2 Language service for Hive query

Microsoft Azure Service Fabric Tools for Visual Studio 2.5 Microsoft Azure Service Fabric Tools for Visual Studio

Microsoft Azure Stream Analytics Language Service 2.3.7000.2 Language service for Azure Stream Analytics

Microsoft Azure Stream Analytics Node 1.0 Azure Stream Analytics Node under Azure Node

Microsoft Azure Tools 2.9 Microsoft Azure Tools for Microsoft Visual Studio 0x10 - v2.9.0.0

Microsoft Continuous Delivery Tools for Visual Studio 0.4 Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager 1.0 Install client-side libraries easily to any web project

Microsoft MI-Based Debugger 1.0 Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards 1.0 Microsoft Visual C++ Wizards

Microsoft Visual Studio Tools for Containers 1.1 Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Microsoft Visual Studio VC Package 1.0 Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio 16.0.300 (573eda3) Support for debugging Mono processes with Visual Studio.

Node.js Tools 1.5.10301.2 Commit Hash:9c34eb81d73db6babeb71674feb1cb437dba9f2f Adds support for developing and debugging Node.js apps in Visual Studio

NuGet Package Manager 5.0.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

ProjectServicesPackage Extension 1.0 ProjectServicesPackage Visual Studio Extension Detailed Info

ResourcePackage Extension 1.0 ResourcePackage Visual Studio Extension Detailed Info

ResourcePackage Extension 1.0 ResourcePackage Visual Studio Extension Detailed Info

Snapshot Debugging Extension 1.0 Snapshot Debugging Visual Studio Extension Detailed Info

SQL Server Data Tools 16.0.61903.25110 Microsoft SQL Server Data Tools

ToolWindowHostedEditor 1.0 Hosting json editor into a tool window

TypeScript Tools 16.0.10306.2001 TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 3.0.0-beta4-19170-01+1deafee3682da88bf07d1c18521a99f47446cee8 Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 10.4 for F# 4.6 16.0.0.0. Commit Hash: 809f41207b74a1356208f11b8fa3a15233734050. Microsoft Visual F# Tools 10.4 for F# 4.6

Visual Studio Code Debug Adapter Host Package 1.0 Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for Containers 1.0 Visual Studio Tools for Containers

Visual Studio Tools for Kubernetes 1.0 Visual Studio Tools for Kubernetes

VisualStudio.Mac 1.0 Mac Extension for Visual Studio

Xamarin 16.0.0.513 (d16-0) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 4.17.4.413 (remotes/origin/d16-0) Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 16.1.43 (fe3ade5) Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 9.2.0.5 (HEAD/292d27fa) Xamarin.Android Reference Assemblies and MSBuild support. Mono: mono/mono/2018-08-rc Java.Interop: xamarin/java.interop/d16-0 LibZipSharp: grendello/LibZipSharp/master LibZip: nih-at/libzip/rel-1-5-1 MXE: xamarin/mxe/xamarin ProGuard: xamarin/proguard/master SQLite: xamarin/sqlite/3.26.0 Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-0

Xamarin.iOS and Xamarin.Mac SDK 12.6.0.23 (ad57f87) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support. ```

Build Logs

Example Project (If Possible)

VS bug #844539

该提问来源于开源项目:xamarin/xamarin-macios

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

42条回答

  • weixin_39744384 weixin_39744384 4月前

    did you find a solution? Does it work for you now?

    I can't even perform the "Migrate packages.config to..." action anymore:

    image

    NuGet 5.4

    image

    点赞 评论 复制链接分享
  • weixin_39758048 weixin_39758048 4月前

    yea, deleting every iOS extension project reference from my iOS project, update the NuGet packages and readd those references... It's so sad that this issue is now here for about a year and Microsoft does not solve this... But hey, the SplitView issue on iPad with MasterDetail in Xamarin.Forms is there for 4 years now and not solved yet so why the hurry... x)

    点赞 评论 复制链接分享
  • weixin_39744384 weixin_39744384 4月前

    I think I've might have found a simple way to make it work:

    1. Install NuGet 5.4.0 and add the ReferenceOutputAssembly key
    2. Unload the WatchOSApp project
    3. Migrate from packages.config -> PackageReference for App.iOS project
    4. Click "Save all" (I feel the csproj files are not automatically saved)
    5. Reload WatchOSApp

    For updating packages: 1. Unload the WatchOSApp project 2. Update packages in App.iOS project 3. Reload WatchOSApp

    I am now finally having PackageReferences in my App.iOS project.

    I guess the issue could be closed.

    点赞 评论 复制链接分享
  • weixin_39974882 weixin_39974882 4月前

    it shouldn't be necessary to go through those hoops, so there's still something for us to fix (i.e. I prefer to keep this issue open).

    点赞 评论 复制链接分享
  • weixin_39644750 weixin_39644750 4月前

    Issue is still here... is it really so hard to fix such annoying stuff?

    点赞 评论 复制链接分享
  • weixin_39647977 weixin_39647977 4月前

    Issue is still here... is it really so hard to fix such annoying stuff?

    I'd say not hard (especially since WatchOS apps have their own keys in the PackageReference) but probably just not interesting to any of the devs. Why do a small quality of life fix that barely anyone would notice?

    sigh

    点赞 评论 复制链接分享
  • weixin_39634052 weixin_39634052 4月前

    Hi,

    Could someone please explain to me how to resolve this:

    
    Severity    Code    Description Project File    Line    Suppression State
    Error   NU1201  Project App1.WatchOSApp is not compatible with xamarinios10 (Xamarin.iOS,Version=v1.0) / win-x64. Project App1.WatchOSApp supports: xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0) WatchTest.iOS   C:\Users\za\source\repos\WatchTest\WatchTest\WatchTest.iOS\WatchTest.iOS.csproj 1   
    Error   NU1201  Project App1.WatchOSApp is not compatible with xamarinios10 (Xamarin.iOS,Version=v1.0) / win-x86. Project App1.WatchOSApp supports: xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0) WatchTest.iOS   C:\Users\za\source\repos\WatchTest\WatchTest\WatchTest.iOS\WatchTest.iOS.csproj 1   
    Error   NU1201  Project App1.WatchOSApp is not compatible with xamarinios10 (Xamarin.iOS,Version=v1.0) / win. Project App1.WatchOSApp supports: xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0) WatchTest.iOS   C:\Users\za\source\repos\WatchTest\WatchTest\WatchTest.iOS\WatchTest.iOS.csproj 1   
    Error   NU1201  Project App1.WatchOSApp is not compatible with xamarinios10 (Xamarin.iOS,Version=v1.0). Project App1.WatchOSApp supports: xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0)   WatchTest.iOS   C:\Users\za\source\repos\WatchTest\WatchTest\WatchTest.iOS\WatchTest.iOS.csproj 1
    

    I have already manually modified my main iOS Project file to this:

    
        <projectreference include="..\..\App1\App1.WatchOSApp\App1.WatchOSApp.csproj">
          <project>{99abb3de-9fcf-47da-93a2-ceb9008e6aa2}</project>
          <name>App1.WatchOSApp</name>
          <referenceoutputassembly>false</referenceoutputassembly>
          <iswatchapp>true</iswatchapp>
        </projectreference>
    

    But that does not make the above error go away.

    I am using VS2019 on Windows 16.6.1

    Xamarin 16.6.000.1061 (d16-6) Xamarin Designer 16.6.0.318 (remotes/origin/d16-6) Xamarin Templates 16.6.40 (1f1466f) Xamarin.iOS and Xamarin.Mac SDK 13.18.2.1 (29c4ea7)

    Thank you!

    点赞 评论 复制链接分享
  • weixin_39634052 weixin_39634052 4月前

    After hours of trying - it's randomly now working.....

    点赞 评论 复制链接分享
  • weixin_39849479 weixin_39849479 4月前

    Hi all, just wanted to confirm, the issue still persists in Visual Studio 2019 Community for Windows. I'm using Version 16.6.2 and have added both the ReferenceOutputAssembly and IsWatchApp nodes to my parent iOS App's .csproj file and am still getting the same error on build or trying to refresh the packages.

    点赞 评论 复制链接分享
  • weixin_39919165 weixin_39919165 4月前

    I have this issue on VS 2019 Enterprise (Windows, v16.6.3, Xamarin iOS 13.18.2.1). My iOS csproj already contains <ReferenceOutputAssembly>false</ReferenceOutputAssembly>. I have to use PackageReference because without it, I am unable to update to latest version of Xamarin Essentials (System.Drawing.Common.dll not found in GAC error).

    Should the WatchExtension project be migrated to PackageReference / would that cause any harm?

    点赞 评论 复制链接分享
  • weixin_39974882 weixin_39974882 4月前

    I see above that it only happens on VS (on Windows) for you, in that case the VS team will have to look at it (they already know about this bug, and hopefully they'll have time soon to look into it).

    点赞 评论 复制链接分享
  • weixin_39744384 weixin_39744384 4月前

    Could you provide a link to the VStudio issue? Soon will be 1 year since the issue was reported, the problem is still not solved and having the old packages.config format prevents me from installing NuGet packages (e.g. ACR.UserDialogs).

    TIA

    点赞 评论 复制链接分享
  • weixin_39781594 weixin_39781594 4月前

    I had this issue, and the solution for me was to use a newer version of NuGet.

    点赞 评论 复制链接分享
  • weixin_39980234 weixin_39980234 4月前

    I confirm by using nuget version 5.4.0 & adding the ReferenceOutputAssembly property the issue is fixed

    点赞 评论 复制链接分享
  • weixin_39744384 weixin_39744384 4月前

    I use 5.4.0 and the ReferenceOutputAssembly property and on VStudio 2019 for Windows it still does not work.

    点赞 评论 复制链接分享
  • weixin_39974882 weixin_39974882 4月前

    no idea so far (except not using PackageReferences...)

    点赞 评论 复制链接分享
  • weixin_39974882 weixin_39974882 4月前

    can you try adding <ReferenceOutputAssembly>False</ReferenceOutputAssembly> to the watch app reference in the main iOS project's csproj:

    xml
        <projectreference include="..\WatchApp3\WatchApp3.csproj">
          <project>{79EB034F-3D29-43A5-B89F-124879504771}</project>
          <name>WatchApp3</name>
          <iswatchapp>True</iswatchapp>
          <referenceoutputassembly>False</referenceoutputassembly>
        </projectreference>
    

    and see if that works?

    点赞 评论 复制链接分享
  • weixin_39744384 weixin_39744384 4月前

    I had it already, does not help.

    `

      <IsAppExtension>false</IsAppExtension>
    
      <IsWatchApp>true</IsWatchApp>
    
      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
    

    `

    For now I brought back the good old packages.config and everything works well again :)

    点赞 评论 复制链接分享
  • weixin_39974882 weixin_39974882 4月前

    what exactly are your changes to the csprojs to switch to package references? Can you create a diff (git diff or the equivalent for your system)?

    I'm using this diff for the ios-samples/watchOS/WatchKitCatalog sample, and it works fine.

    点赞 评论 复制链接分享
  • weixin_39744384 weixin_39744384 4月前

    I have attached a diff between the original csproj (using packages.config) and what the "Right click on packages.config and choose 'Migrate packages.config to PackageReferences" did.

    diff.zip

    Note: for the shared .NET Standard 2.0, Android, WatchApp, WatchExtension and UWP apps the migration went well; only the iOS project had this small 'glitch'.

    点赞 评论 复制链接分享
  • weixin_39974882 weixin_39974882 4月前

    I tried to replicate something similar with the WatchKitCatalog sample, but no success, it still works (https://gist.github.com/rolfbjarne/4763fcb947bfdcc4410cdf0c30129fe5).

    Can you attach your three csproj files? Maybe there's something strange in one of them.

    点赞 评论 复制链接分享
  • weixin_39744384 weixin_39744384 4月前

    Attached all 3 projects (the iOS in both versions, with and without packages.config) project_files.zip

    点赞 评论 复制链接分享
  • weixin_39974882 weixin_39974882 4月前

    I still can't repro any problems with nuget restore on those projects 😒, I updated the ProjectReferences to point to the new locations, and everything restored just fine. Then I removed the <ReferenceOutputAssembly>false</ReferenceOutputAssembly> from PTMate.iOS_PackageReference.ccsproj, and the problem showed up.

    can you run the following commands on your Mac (remember to fix the path to your solution):

    
    nuget restore -Verbosity detailed  /path/to/mysolution.sln
    mono --version
    which nuget
    

    and attach the output here?

    点赞 评论 复制链接分享
  • weixin_39744384 weixin_39744384 4月前

    I am not using Visual Studio for Mac, I am using Visual Studio 2019 on a Windows machine (and build using a remote Mac Mini).

    Could it be that this is only a VS2019/Windows problem?

    点赞 评论 复制链接分享
  • weixin_39974882 weixin_39974882 4月前

    Yes, it could be a VS2019/Windows problem (although usually msbuild/nuget problems usually occur on the Mac and not on Windows).

    Can you copy your solution to your Mac and check if the nuget restore command works there? That would determine if it's a Windows problem or not.

    点赞 评论 复制链接分享
  • weixin_39744384 weixin_39744384 4月前

    I can confirm that using the iOS project having PackageReferences, on a Mac machine, using VStudio 2019 for Mac, it builds without problems.

    I have attached the "nuget restore -Verbosity detailed" results. Mono version 5.18.1.3 Nuget: /library/Frameworks/Mono.framework/Versions/Current/Commands/nuget

    file.zip

    点赞 评论 复制链接分享
  • weixin_39974882 weixin_39974882 4月前

    Great, thanks, I'll move this to my Windows colleagues then.

    点赞 评论 复制链接分享
  • weixin_39758048 weixin_39758048 4月前

    I have the same issue and can confirm it is only a problem on Windows and not on macOS but it also affected VS2017. It works on the mac just fine while Windows keeps failing.

    
    Severity    Code    Description Project File    Line    Suppression State
    Error   NU1201  Project MyApp.iOS.Watch.WatchOSExtension is not compatible with xamarinios10 (Xamarin.iOS,Version=v1.0) / win-x86. Project MyApp.iOS.Watch.WatchOSExtension supports: xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0)   MyApp.iOS   E:\Git\MyApp\MyApp\MyApp\MyApp.iOS\MyApp.iOS.csproj 1   
    Error   NU1201  Project MyApp.iOS.Watch.WatchOSExtension is not compatible with xamarinios10 (Xamarin.iOS,Version=v1.0). Project MyApp.iOS.Watch.WatchOSExtension supports: xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0) MyApp.iOS   E:\Git\MyApp\MyApp\MyApp\MyApp.iOS\MyApp.iOS.csproj 1   
    Error   NU1201  Project MyApp.iOS.Watch.WatchOSExtension is not compatible with xamarinios10 (Xamarin.iOS,Version=v1.0) / win-x64. Project MyApp.iOS.Watch.WatchOSExtension supports: xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0)   MyApp.iOS   E:\Git\MyApp\MyApp\MyApp\MyApp.iOS\MyApp.iOS.csproj 1   
    Error   NU1201  Project MyApp.iOS.Watch.WatchOSExtension is not compatible with xamarinios10 (Xamarin.iOS,Version=v1.0) / win. Project MyApp.iOS.Watch.WatchOSExtension supports: xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0)   MyApp.iOS   E:\Git\MyApp\MyApp\MyApp\MyApp.iOS\MyApp.iOS.csproj 1   
    
    
    点赞 评论 复制链接分享
  • weixin_39828198 weixin_39828198 4月前

    I'm seeing this on macOS, where nuget restore fails, while Visual Studio for Mac restores and builds just fine.

    点赞 评论 复制链接分享
  • weixin_39828198 weixin_39828198 4月前

    Any updates on this? Just a gentle reminder that this is happening on macOS as well, not just on Windows.

    点赞 评论 复制链接分享
  • weixin_39974882 weixin_39974882 4月前

    if you see this only on macOS, it could be a different issue, so could you please file a new issue with all your details + verbose build logs so that we can have a look? If you have a test solution as well that would be even better.

    点赞 评论 复制链接分享
  • weixin_39828198 weixin_39828198 4月前

    I should be able to create a small repro and a new issue, but before doing so, I'm just wondering if this is indeed the same issue, as I've manually migrated all projects to use PackageReference?

    The errors are exactly the same, and this is a large multi-platform Xamarin.Forms projects, with hundreds of dependencies per project, so I'd definitely prefer not having to rollback, for both speed and maintenance reasons. The migration made a huge impact on both.

    Just a quick tl;dr version of the issue: VS4Mac builds fine, and it only throws those errors when building from the command line, which breaks Fastlane automation, CI etc.

    点赞 评论 复制链接分享
  • weixin_39974882 weixin_39974882 4月前

    if the build works fine from the IDE, but not from the command line, you should be able to compare build logs for the two and see where the difference is.

    点赞 评论 复制链接分享
  • weixin_39828198 weixin_39828198 4月前

    Sorry for the radio silence. Digging in to the detailed logs this week, but figured I'd update on this in the mean time.

    So the issue isn't with building, and everything builds fine in VS4Mac as well as with msbuild. The issue comes from NuGet, where nuget restore is what's causing the errors, and I'm not yet sure if the only reason this works in VS4Mac, is because I have the packages cached locally, and if it would break in case of a fresh install/restore.

    UPDATE: Found a workaround! As the error comes from NuGet, but doesn't actually abort the package restore process, I figured I'd try to simply ignore the error, which seems to have worked.
    I first ran nuget locals -clear all to remove cached packages, then switched my build process to use two steps, eg. nuget restore || true and msbuild ..., which so far seems to have worked.
    Error is still there, but at least I can work around it, and I can't believe it took me this long to discover.

    点赞 评论 复制链接分享
  • weixin_39974882 weixin_39974882 4月前

    See also #7477.

    点赞 评论 复制链接分享
  • weixin_39974882 weixin_39974882 4月前

    The fix is to add <ReferenceOutputAssembly>false</ReferenceOutputAssembly> to the project reference in the iOS project's csproj, so that it looks like this:

    xml
          <projectreference include="thewatchapp\thewatchapp.WatchOSApp\thewatchapp.WatchOSApp.csproj">
            <iswatchapp>true</iswatchapp>
            <project>{81724650-5BDE-4259-816A-2FA4F2A4E97D}</project>
            <name>thewatchapp.WatchOSApp</name>
            <referenceoutputassembly>false</referenceoutputassembly> <!-- add this line -->
          </projectreference>
    
    点赞 评论 复制链接分享
  • weixin_39758048 weixin_39758048 4月前

    No it's not. It is already in my *.csproj file and still this error pops up all the time. I always have to remove the references to my iOS extension projects before I can update NuGet packages... it's so annoying...

    点赞 评论 复制链接分享
  • weixin_39974882 weixin_39974882 4月前

    can you show me your csproj files (all of them)?

    点赞 评论 复制链接分享
  • weixin_39758048 weixin_39758048 4月前

    Sure, here it is: https://pastebin.com/8YswThyg

    The watchOS App already has the flag you mentioned. I also added it temporarly for the Today Extension because both are throwing this error around but it didn't change anything for me.

    点赞 评论 复制链接分享
  • weixin_39974882 weixin_39974882 4月前

    can you execute the following in your solution's directory:

    
    nuget restore -verbosity detailed
    

    and attach the output?

    点赞 评论 复制链接分享
  • weixin_39758048 weixin_39758048 4月前

    The restore is working fine just when updating the packages this causes issues (which than leads to revert of the update). Even with the error listed in the error window, I can compile and run my app just fine. Will your command generates the required output anyway?

    点赞 评论 复制链接分享
  • weixin_39744384 weixin_39744384 4月前

    Any workaround for now?

    点赞 评论 复制链接分享

相关推荐