-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS Notification Service Extension Deploy Fails #1386
Comments
From @sarahfmurray on Mon, 29 Jul 2024 09:39:08 GMT I am having the exact same problem. I've been trying so many things for weeks to fix it, thinking it may have been the entitlements being slightly wrong or something, but if you're getting the same error with a clean project then it can't be that. But your comment on the other thread has saved me (for now), so now I'm building an ipa in debug mode, and deploying that to my test iPhone. Thank you! |
From @rolfbjarne on Tue, 06 Aug 2024 08:05:14 GMT The test solution works if I change the bundle identifier of the extension to be prefixed with the main app's bundle identifier: diff --git a/MauiDebugNotificationServiceExtension/Info.plist b/MauiDebugNotificationServiceExtension/Info.plist
index 2fa14d3..5abb1bf 100644
--- a/MauiDebugNotificationServiceExtension/Info.plist
+++ b/MauiDebugNotificationServiceExtension/Info.plist
@@ -7,7 +7,7 @@
<key>CFBundleName</key>
<string>MauiDebugNotificationServiceExtension</string>
<key>CFBundleIdentifier</key>
- <string>MauiDebugNotificationServiceExtension</string>
+ <string>com.companyname.mauidebug.NotificationServiceExtension</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleInfoDictionaryVersion</key>
diff --git a/MauiDebugNotificationServiceExtension/MauiDebugNotificationServiceExtension.csproj b/MauiDebugNotificationServiceExtension/MauiDebugNotificationServiceExtension.csproj
index 6a1f5e7..38de6c5 100644
--- a/MauiDebugNotificationServiceExtension/MauiDebugNotificationServiceExtension.csproj
+++ b/MauiDebugNotificationServiceExtension/MauiDebugNotificationServiceExtension.csproj
@@ -3,7 +3,7 @@
<TargetFrameworks>net8.0-ios</TargetFrameworks>
<OutputType>Library</OutputType>
- <ApplicationId>MauiDebugNotificationServiceExtension</ApplicationId>
+ <ApplicationId>com.companyname.mauidebug.NotificationServiceExtension</ApplicationId>
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion> That said, the error code 0xe8008014 you're getting indicates a signing problem. Can you get a binary build log (https://github.com/xamarin/xamarin-macios/wiki/Diagnosis#binary-build-logs) of your app and attach it here? |
From @borigas on Tue, 06 Aug 2024 18:36:27 GMT @rolfbjarne thanks for taking a look. I pushed updates to the repro repo with the changes you suggested, but I'm still getting the same error. Here's a binlog from the latest attempt in VS. It wouldn't let me upload with .binlog as the extension, so just change it back after downloading. |
From @rolfbjarne on Wed, 07 Aug 2024 14:06:15 GMT
That looks good to me. Can you try creating a dummy Xcode project + a notification service extension and see if that works (use the same bundle identifier as the sample project)? Sometimes Xcode is able to automatically fix signing problems, so if it works, try again with your .NET project to see if it's been fixed. |
From @borigas on Wed, 07 Aug 2024 15:23:23 GMT I'm able to deploy a dummy app and extension with the same bundle ids from XCode, but still get the same error from VS. |
From @rolfbjarne on Thu, 08 Aug 2024 10:41:37 GMT Does it work if you use VSCode on the Mac directly? |
From @borigas on Thu, 08 Aug 2024 17:47:38 GMT Still doesn't work in VSCode. 2 observations that are possibly related:
|
From @rolfbjarne on Fri, 09 Aug 2024 11:37:00 GMT
Are these the same provisioning profiles the Xcode sample uses?
It looks like you deployed the extension, but you have to deploy the main app (which will include the extension). AFAIK VS doesn't allow you to do this, but I'm not sure if VSCode prevents you from doing it. |
From @borigas on Fri, 09 Aug 2024 19:27:46 GMT
Yes, they're the same profile Xcode says it's using
I think I am deploying the main app. I think VS Code is also filtering the extension, so there's only the app project to choose from. I could be wrong, but it seems like it's correctly trying to install the main app and extension, but failing because the extension isn't signed. |
From @rolfbjarne on Mon, 12 Aug 2024 09:35:26 GMT OK, let's do this on the command line then, to minimize noise from elsewhere.
What's the complete output of the last command? I know you tried to invoke mlaunch directly before, but then you tried to install a build for the simulator (see "iossimulator-arm64" in the command line somewhere), which obviously didn't work. |
From @borigas on Mon, 12 Aug 2024 16:26:37 GMT Good catch on simulator being in there. I think there was something else I was testing on the simulator and I reused that command without updating. Using Here's the output from mlaunch:
|
From @rolfbjarne on Mon, 12 Aug 2024 17:05:07 GMT Yes, that's a successful installation. Is the app extension working on the device? |
From @borigas on Mon, 12 Aug 2024 17:53:02 GMT Yep, it's working when installed via mlaunch. Seems like VS Code and VS are trying to do something slightly different to install? |
From @borigas on Mon, 12 Aug 2024 18:27:20 GMT Actually, re-reading your question, I haven't proven the extension is working. The main app itself is working, but I don't know a good way to verify the extension without jumping through Apple hoops to send APNS to that repro bundle id. Any suggestions? |
From @rolfbjarne on Thu, 15 Aug 2024 10:11:12 GMT
You could just change the bundle id in your repro project to the one for your real project. |
From @borigas on Fri, 16 Aug 2024 16:28:44 GMT Fair enough. I was trying to keep things identical to the repro repo, but that's an easy solution. The NSE is running when installed via |
From @rolfbjarne on Wed, 21 Aug 2024 15:40:58 GMT I can reproduce the problem where VSCode for some reason tries to install the extension, even if the main project is the startup project. This seems like a bug in VSCode, so I'm moving this issue there. |
Thank you! I can confirm that building and installing an app with a Call Directory Extension works from command line (dotnet build and mlaunch). As i spent some time trying to find a solution to this issue, After Launching, i see the following in the debug console. As you mentioned, VS Code tries to install the appex instead of the app.
Here's the reproduction project (just the hello world app and an extension): Hope this helps. |
Hi all, Sorry for the late reply. I'm marking this an enhancement as neither Visual Studio nor the .NET MAUI extension for Visual Studio Code support .NET iOS app extensions. Visual Studio only supports Xamarin.iOS app extensions. That said, referencing an app extension from your app project should not prevent from deploying it, but we can treat that as a separate issue. |
I want to make sure I'm understanding correctly. I think you're saying MAUI iOS Service Extensions are supported, but not in VS/VS Code Maui Extension. Is that correct? |
That's correct, there is not tooling support for this type of projects. |
I find it absolutely insane that this is marked as "enhancement", for example we are trying to migrate a enterprise Xamarin app to MAUI, and neither visual studio or visual studio code is able to deploy the app because of the extension. Sure, a obscure workaround exists but then guess what, Xcode gets updated to 16 and it no longer works. (dotnet/maui#24799) You kill Xamarin support and tell people to migrate to MAUI. Then why MAUI tooling does not support basic iOS features like extensions. |
Agreed with @wojciechkapko |
I have migrated my app from Xamarin to .net-ios some time ago and the deployment of app and extension worked with Visual Studio for Mac without problems. But now VS for MAC is deprecated as well and I need to switch to VS2022. Also with the iOS updates we have to migrate to newer versions. Like the two comments from wojciechkapko and LucaDuttoTD I am not happy how this is handled. Libraries/Tools like Xamarin and Visual Studio for Mac get marked as deprecated and are not supported with updates anymore and we have to migrate to .net-ios and VS2022 with less features then before (e.g. without support for extension). |
Hi, I am having similar issue with iOS Call Extension project. Not able to deploy using VS on windows or VS Code on MAC. I tried mlaunch command as well. Only my MAUI App is getting deployed but not the extension. Jon Goldberger from Microsoft suggested to post here if you have any input. |
My suggestion would be to migrate away from maui to literally anything else. |
Can you try building and running the main project from the command line:
This should launch the app on the device, but a side effect is that it the app extension will be installed. If this doesn't work (i.e. the app extension isn't installed), please attach the resulting |
The problem with specifying properties on the command line is that they will apply to all projects (and they'll also override whatever is in the project files). My recommendation would be to add the codesigning properties in the project files, potentially behind another property you can set from the command line: <PropertyGroup Condition="'$(CodesignConf)' == 'Distribution'">
<CodesignKey>Apple Distribution: John Smith (AY2GDE9QM7)</CodesignKey>
<CodesignProvision>MyMauiApp</CodesignProvision>
</PropertyGroup> and then in the extension project, the correct values for the extension project: <PropertyGroup Condition="'$(CodesignConf)' == 'Distribution'">
<CodesignKey>Apple Distribution: John Smith (AY2GDE9QM7)</CodesignKey>
<CodesignProvision>MyMauiExtension</CodesignProvision>
</PropertyGroup> and finally build from the command line like this:
|
@rolfbjarne After removing codesign properties from command line it worked, I was able to publish ipa with extension. Thanks. |
From @borigas on Thu, 18 Jul 2024 21:14:21 GMT
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.
It looks like docs on how to use this haven't been done yet (dotnet/docs-maui#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:
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8053/tools/bin/mlaunch --installdev ~/Library/Caches/Xamarin/mtbs/builds/MauiDebug/a30afb1d33bf5430897cbab9d42475927750458aadbcba47ce68f91a270a4fc6/bin/Release/net8.0-ios/iossimulator-arm64/MauiDebug.app --devname ocv6splus --wait-for-exit:false
error MT1006: Could not install the application '~/Library/Caches/Xamarin/mtbs/builds/MauiDebug/a30afb1d33bf5430897cbab9d42475927750458aadbcba47ce68f91a270a4fc6/bin/Release/net8.0-ios/iossimulator-arm64/MauiDebug.app' on the device 'ocv6splus': AMDeviceSecureInstallApplicationBundle returned: 0xe8008014
dotnet build
:dotnet build -t:Run -f net8.0-ios -p:RuntimeIdentifier=ios-arm64 -p:_DeviceName="ocv6splus"
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:
Expected Behavior
The app and the extension both deploy and run
Actual Behavior
Both fail to deploy
Environment
Version information
Build Logs
Example Project (If Possible)
https://github.com/borigas/NotificationServiceExtensionRepro
Copied from original issue xamarin/xamarin-macios#20918
The text was updated successfully, but these errors were encountered: