-
Notifications
You must be signed in to change notification settings - Fork 515
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 #20918
Comments
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! |
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? |
@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. |
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. |
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. |
Does it work if you use VSCode on the Mac directly? |
Still doesn't work in VSCode. 2 observations that are possibly related:
|
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. |
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. |
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:
|
Yes, that's a successful installation. Is the app extension working on the device? |
Yep, it's working when installed via mlaunch. Seems like VS Code and VS are trying to do something slightly different to install? |
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? |
You could just change the bundle id in your repro project to the one for your real project. |
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 |
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. |
This issue was moved to microsoft/vscode-dotnettools#1386 |
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
The text was updated successfully, but these errors were encountered: