dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.98k stars 1.71k forks source link

iOS Notification Service Extension Deploy Fails #22586

Closed borigas closed 3 months ago

borigas commented 3 months ago

Description

I'm trying to add an iOS Notification Service Extension to my app, but I can't get it to deploy from VS. I am connected to a Mac and have a device selected.

------ Deploy started: Project: MauiDebugNotificationServiceExtension, Configuration: Release Any CPU ------
Please select a valid device before running the application.
Deploy failed
------ Deploy started: Project: MauiDebug, Configuration: Release Any CPU ------
Xamarin.iOS does not support deploying the previous version. Please ensure your solution builds before deploying it.
Deploy failed
========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 2:19 PM and took 26.135 seconds ==========
========== Deploy: 0 succeeded, 2 failed, 0 skipped ==========
========== Deploy completed at 2:19 PM and took 26.135 seconds ==========

It looks like docs on how to use this haven't been done yet (https://github.com/dotnet/docs-maui/issues/1434). Instead, I referenced and tested a handful of 3rd party examples, but I get the same behavior. Examples referenced:

Other things I've tried include:

Steps to Reproduce

Try to run/deploy/debug from https://github.com/borigas/NotificationServiceExtensionRepro or any of the other examples mentioned above.

Or create a fresh Maui app with an iOS extension. To modify the Xamarin iOS extension to .NET 8, use this csproj:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFrameworks>net8.0-ios</TargetFrameworks>
    <OutputType>Library</OutputType>

    <ApplicationId>MauiDebugNotificationServiceExtension</ApplicationId>

    <ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
    <ApplicationVersion>1</ApplicationVersion>

    <Nullable>enable</Nullable>
    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
    <ImplicitUsings>enable</ImplicitUsings>
    <SupportedOSPlatformVersion>15.4</SupportedOSPlatformVersion>
  </PropertyGroup>

  <PropertyGroup>
    <IsAppExtension>True</IsAppExtension>
    <IsWatchExtension>False</IsWatchExtension>
  </PropertyGroup>
</Project>

Link to public reproduction project repository

https://github.com/borigas/NotificationServiceExtensionRepro

Version with bug

8.0.21 SR4.1

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI, Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

No, I have not been able to work around this problem. This is a blocker for me.

Relevant log output

No response

github-actions[bot] commented 3 months ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

jaosnz-rep commented 3 months ago

Can repro this issue at iOS platform on the latest 17.11 Preview 1(8.0.40/8.0.21). https://github.com/borigas/NotificationServiceExtensionRepro

dotnet-policy-service[bot] commented 3 months ago

Thanks for the issue report @borigas! This issue appears to be a problem with Visual Studio, so we ask that you use the VS feedback tool to report the issue. That way it will get to the routed to the team that owns this experience in VS.

If you encounter a problem with Visual Studio, we want to know about it so that we can diagnose and fix it. By using the Report a Problem tool, you can collect detailed information about the problem, and send it to Microsoft with just a few button clicks.

  1. Go to the Visual Studio for Windows feedback tool or Visual Studio for Mac feedback tool to report the issue
  2. Close this bug, and consider adding a link to the VS Feedback issue so that others can follow its activity there.
dotnet-policy-service[bot] commented 3 months ago

Thanks for the issue report @borigas! This issue appears to be a problem with Visual Studio (Code), so we ask that you use the VS feedback tool to report the issue. That way it will get to the routed to the team that owns this experience in VS (Code).

If you encounter a problem with Visual Studio or the .NET MAUI VS Code Extension, we want to know about it so that we can diagnose and fix it. By using the Report a Problem tool, you can collect detailed information about the problem, and send it to Microsoft with just a few button clicks.

  1. Go to the Visual Studio for Windows feedback tool or .NET MAUI VS Code Extension repository to report the issue
  2. Close this bug, and consider adding a link to the VS Feedback issue so that others can follow its activity there.
borigas commented 3 months ago

I'm not convinced this is a problem with VS or VS Code. I can't deploy an iOS extension using VS, VS Code, dotnet run, or mlaunch. That said, I have created a feedback item at https://developercommunity.visualstudio.com/t/iOS-Notification-Service-Extension-Deplo/10665806 as well

mattleibow commented 3 months ago

This is more likely an issue with the iOS SDK or the mlaunch tooling. Probably not directly IDE issues, but the people that fix deployment issues are the best. And since this is also VS and Pair to Mac, I am thinking this is best on that side.

I'm closing this one as you opened a new one in the developer community where IDE people live.

borigas commented 2 months ago

It's been 3 weeks since I posted using the VS feedback tool but haven't seen any evidence that a human even read it. Are you sure the IDE folks are still there?

I also want to clarify from your previous post that this is not VS or Pair to Mac specific. It does fail from VS with Pair to Mac, but also fails from VS Code on a Mac, from dotnet run directly on a Mac, and from mlaunch directly on a Mac.

trampster commented 2 months ago

We are also having this issue.

borigas commented 2 months ago

My workaround so far is to make my reference to the iOS extension project have a condition so I can skip it when deploying from VS. At least that allows the rest of my app to deploy. Then my build server sets a property to enable the extension project so it gets packaged in the IPA. It makes for a pretty terrible dev loop, but at least it's possible to deploy the rest of my app again.

borigas commented 1 month ago

I created https://github.com/xamarin/xamarin-macios/issues/20918 to see if they're able to offer insight. Visual Studio Developer Community doesn't seem to have anyone reading issues.