Skip to content
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

ITMS-90078: Missing Push Notification Entitlement when building with iOS SDK 17.5.8018 #21002

Closed
velocitysystems opened this issue Aug 8, 2024 · 42 comments · Fixed by #21012
Closed
Labels
bug If an issue is a bug or a pull request a bug fix regression The issue or pull request is a regression
Milestone

Comments

@velocitysystems
Copy link

Steps to Reproduce

CI/CD builds from Azure Pipelines for our MAUI application have begun producing .ipa's with the following warning:

ITMS-90078: Missing Push Notification Entitlement - Your app appears to register with the Apple Push Notification service, but the app signature's entitlements do not include the 'aps-environment' entitlement. If your app uses the Apple Push Notification service, make sure your App ID is enabled for Push Notification in the Provisioning Portal, and resubmit after signing your app with a Distribution provisioning profile that includes the 'aps-environment' entitlement. Xcode does not automatically copy the aps-environment entitlement from provisioning profiles at build time. This behavior is intentional. To use this entitlement, either enable Push Notifications in the project editor's Capabilities pane, or manually add the entitlement to your entitlements file. For more information, see https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/HandlingRemoteNotifications.html#//apple_ref/doc/uid/TP40008194-CH6-SW1.

The application does not have a "Push Notification Entitlement".
No changes have been made to entitlements, profile etc.
No code changes have been made.

Began happening on 7 August 2024 when we bumped to macOS 14 / Xcode 15.4 and dotnet workload install began installing the latest SDK version. Builds from the day before did not generate any warnings with the following configuration:

macOS 13
Current image version: 20240728.2
Microsoft.iOS.Sdk version 17.2.8078
Microsoft.Maui.Sdk version 8.0.61

Expected Behavior

An ITMS-90078 warning should not be produced.

Actual Behavior

An ITMS-90078 warning is produced with Microsoft.iOS.Sdk 17.5.8018.

Environment

Azure Pipelines: macOS-14 (20240804.1)
Xcode 15.4
Microsoft.iOS.Sdk 17.5.8018
Microsoft.Maui.Sdk 8.0.71

@rolfbjarne
Copy link
Member

Would you be able to provide the before and after .ipa files so that we can try to compare to see what triggers this change?

@rolfbjarne rolfbjarne added the need-info Waiting for more information before the bug can be investigated label Aug 8, 2024
@rolfbjarne rolfbjarne added this to the Future milestone Aug 8, 2024
@velocitysystems
Copy link
Author

Thanks @rolfbjarne. How can I securely provide these to you?

@microsoft-github-policy-service microsoft-github-policy-service bot added need-attention An issue requires our attention/response and removed need-info Waiting for more information before the bug can be investigated labels Aug 8, 2024
@rolfbjarne
Copy link
Member

@velocitysystems the easiest is probably to use a file sharing service like Dropbox and then you can send the sharing link to me ([email protected]).

@velocitysystems
Copy link
Author

Thanks @rolfbjarne. Emailed you just now.

@rolfbjarne
Copy link
Member

I can confirm I got the email and was able to download the .ipas.

I believe this is not preventing you from publishing the app (since it's a warning), is that correct?

@velocitysystems
Copy link
Author

Thanks @rolfbjarne. That is correct but we would ideally like to resolve the issue as soon as possible. Will it be fixed in an upcoming service release?

@rolfbjarne
Copy link
Member

Will it be fixed in an upcoming service release?

I don't know yet, once I've figured out what's causing this I'll be able to say more.

@rolfbjarne rolfbjarne added the regression The issue or pull request is a regression label Aug 9, 2024
rolfbjarne added a commit that referenced this issue Aug 9, 2024
…ces if we're registering protocols in the static registrar.

Pending:

* Update docs
* Tests
* Stats for size improvements

This might be the fix for #21002.
@rolfbjarne rolfbjarne removed the need-attention An issue requires our attention/response label Aug 9, 2024
@rolfbjarne
Copy link
Member

I've identified a change which may be the cause of this problem, and a fix is in progress.

@velocitysystems
Copy link
Author

Thanks @rolfbjarne. We also notice this warning in the log output:

You've implemented -[<UIApplicationDelegate> application:performFetchWithCompletionHandler:], but you still need to add "fetch" to the list of your supported UIBackgroundModes in your Info.plist.

@rolfbjarne
Copy link
Member

Thanks @rolfbjarne. We also notice this warning in the log output:

You've implemented -[<UIApplicationDelegate> application:performFetchWithCompletionHandler:], but you still need to add "fetch" to the list of your supported UIBackgroundModes in your Info.plist.

Yes, that might have the same underlying cause.

@enclave-marc-barry
Copy link

Thanks @rolfbjarne - just to flag we've noticed the same two warnings flagged by our maui ios build of enclave.io (ITMS-90078 email from Apple after upload to testflight, and the add "fetch" to .plist from dotnet build output).

@rolfbjarne rolfbjarne added the bug If an issue is a bug or a pull request a bug fix label Aug 19, 2024
@LSMartijn
Copy link

Same problem here, not able to upload to apple store

@rolfbjarne
Copy link
Member

Same problem here, not able to upload to apple store

According to the original issue description, this particular issue is a warning, and shouldn't block the App Store submission.

Can you post your entire rejection message?

@velocitysystems
Copy link
Author

@rolfbjarne I can confirm this is only a warning for us when submitting an update to our app.

@LSMartijn
Copy link

Same problem here, not able to upload to apple store

According to the original issue description, this particular issue is a warning, and shouldn't block the App Store submission.

Can you post your entire rejection message?

I'm sorry, it is indeed a warning, it shows in the store with a warning: Missing Compliance

And I get an email with the message as shown above.

ITMS-90078: Missing Push Notification Entitlement - Your app appear..... etc

@FranRDev
Copy link

FranRDev commented Aug 28, 2024

I've identified a change which may be the cause of this problem, and a fix is in progress.

Hello, when will the fix be available? @rolfbjarne

@janusw
Copy link

janusw commented Aug 30, 2024

For us, the ITMS-90078 warning started appearing when we moved to .NET SDK 8.0.400 (from 8.0.303) AFAICS.

@rolfbjarne
Copy link
Member

I've identified a change which may be the cause of this problem, and a fix is in progress.

Hello, when will the fix be available? @rolfbjarne

Not in the next/upcoming service release (too late for that), but hopefully in the next one.

Unfortunately I can't be much more specific at this point.

@enclave-marc-barry
Copy link

Thanks for the update @rolfbjarne.

Open question to everyone watching this thread- has anyone pushed to the appstore with this warning, has it generated any back pressure or app review activity from Apple for you?

@DDHSchmidt
Copy link

Thanks for the update @rolfbjarne.

Open question to everyone watching this thread- has anyone pushed to the appstore with this warning, has it generated any back pressure or app review activity from Apple for you?

Just published a new app version on the store today despite the warning and no, no noticeable repercussions yet. Keeping my fingers crossed and following this issue very closely.

azure-pipelines bot pushed a commit that referenced this issue Sep 2, 2024
…ces if we're registering protocols in the static registrar.

Pending:

* Update docs
* Tests
* Stats for size improvements

This might be the fix for #21002.
rolfbjarne pushed a commit that referenced this issue Sep 6, 2024
…tructor for protocol interfaces if we're registering protocols in the static registrar. (#21162)

When we implemented support for using default interface members for binding protocols, we also unintentionally introduced a size regression. This happened because we now tell the linker to keep all methods in a protocol interface, thus all the corresponding types end up marked as well, etc.

This had an additional side effect: depending on the types that weren't linked away anymore, the App Store could flag an app, saying that additional entitlements is needed. This is what's happening in #21002: the App Store detects that the app references the `application:didRegisterForRemoteNotificationsWithDeviceToken:` selector [1] (from the method `RegisteredForRemoteNotifications` on `IUIApplicationDelegate`) and tells the developer they probably need the push notification entitlement.

The good news is that we don't need these protocol interface methods at runtime if the optimization to register protocols with the static registrar is enabled (which it is by default).

In this PR I teach the optimizer to remove the DynamicDependency attributes keeping these protocol interface methods from being trimmed out.

## Size improvements

* monotouch-test build for Release/ios-arm64 shrinks by [2.9mb (-2.6%)](https://gist.github.com/rolfbjarne/5e8ca6ea6854dc4a46f8e838dff11e6b)
* A very simple app (tests/dotnet/MySimpleApp) shrinks by [176kb (-0.3%)](https://gist.github.com/rolfbjarne/f0e062900528eb499fd96d124d18376f)

[1]: This is somewhat speculative, but it's probably not far from what the App Store actually does.

Fixes #21002.

Backport of #21012
@janusw
Copy link

janusw commented Sep 9, 2024

For us, the ITMS-90078 warning started appearing when we moved to .NET SDK 8.0.400 (from 8.0.303) AFAICS.

Can anyone confirm that this issue only affects .NET SDK versions 8.0.4xx, but not 8.0.3xx? If this is indeed the case, then reverting to 3xx might be a viable workaround until a proper fix is available ...

@rolfbjarne
Copy link
Member

For us, the ITMS-90078 warning started appearing when we moved to .NET SDK 8.0.400 (from 8.0.303) AFAICS.

Can anyone confirm that this issue only affects .NET SDK versions 8.0.4xx, but not 8.0.3xx? If this is indeed the case, then reverting to 3xx might be a viable workaround until a proper fix is available ...

No, it won't, because the culprit here is the latest version of the iOS workload, which is the same for both 8.0.4xx and 8.0.3xx (and 8.0.2xx and 8.0.1xx for that matter).

That said, we can provide a workload rollback file, which can be used to downgrade your workloads if need be. Please let us know if this is what you need.

@enclave-marc-barry
Copy link

enclave-marc-barry commented Sep 9, 2024

@rolfbjarne I think it depends on what action Apple are likely to take, if any.

If they do start rejecting updates, and the fix is going to be a few months coming then a rollback file might be helpful.

However, from the activity on this thread it doesn't look like there's been any back pressure from Apple yet over the warning. That said, we've not tried a release since this issue surfaced, so for us this remains a bit of an unknown.

@janusw
Copy link

janusw commented Sep 10, 2024

Can anyone confirm that this issue only affects .NET SDK versions 8.0.4xx, but not 8.0.3xx? If this is indeed the case, then reverting to 3xx might be a viable workaround until a proper fix is available ...

No, it won't, because the culprit here is the latest version of the iOS workload, which is the same for both 8.0.4xx and 8.0.3xx (and 8.0.2xx and 8.0.1xx for that matter).

That said, we can provide a workload rollback file, which can be used to downgrade your workloads if need be. Please let us know if this is what you need.

If this is the only workaround, then yes, I'd be interested in having a short rollback-file snippet with the correct workload versions that are needed to fix it. Thank you, @rolfbjarne!

@rolfbjarne
Copy link
Member

If this is the only workaround, then yes, I'd be interested in having a short rollback-file snippet with the correct workload versions that are needed to fix it. Thank you, @rolfbjarne!

Try this:

  1. Download https://gist.github.com/rolfbjarne/74b27a48abcf1812618e8e63909a74dd and save to rollback.json

  2. Run in a terminal:

    $ sudo dotnet workload install ios --from-rollback-file rollback.json

@janusw
Copy link

janusw commented Sep 11, 2024

Try this:

1. Download https://gist.github.com/rolfbjarne/74b27a48abcf1812618e8e63909a74dd and save to rollback.json

Awesome, thank you. Since the file is rather compact, I'll just paste it here for persistence:

{
  "microsoft.net.sdk.android": "34.0.113/8.0.100",
  "microsoft.net.sdk.ios": "17.2.8022/8.0.100",
  "microsoft.net.sdk.maccatalyst": "17.2.8022/8.0.100",
  "microsoft.net.sdk.macos": "14.2.8022/8.0.100",
  "microsoft.net.sdk.maui": "8.0.72/8.0.100",
  "microsoft.net.sdk.tvos": "17.2.8022/8.0.100",
  "microsoft.net.workload.mono.toolchain.net7": "8.0.0/8.0.100",
  "microsoft.net.workload.mono.toolchain.current": "8.0.0/8.0.100",
  "microsoft.net.workload.emscripten.net7": "8.0.0/8.0.100",
  "microsoft.net.workload.emscripten.current": "8.0.0/8.0.100"
}
2. Run in a terminal:
   ```shell
   $ sudo dotnet workload install ios --from-rollback-file rollback.json
   ```

This command only seems to install/downgrade the ios workload, so I assume the above json file is a bit overblown for the purpse here and could actually be reduced to:

{
  "microsoft.net.sdk.ios": "17.2.8022/8.0.100"
}

Is that correct?

@rolfbjarne
Copy link
Member

This command only seems to install/downgrade the ios workload, so I assume the above json file is a bit overblown for the purpse here and could actually be reduced to:

{
  "microsoft.net.sdk.ios": "17.2.8022/8.0.100"
}

Is that correct?

Potentially, if you only use the iOS workload.

If your project uses Mac Catalyst, Android, MAUI, etc. then you might need the other workloads too (not necessarily because they're broken, but because the specific mix of workload versions you might end up having on your machine are not working well together. The rollback file contains a set of well-known versions that are supposed to work well together).

@enclave-marc-barry
Copy link

Thanks @rolfbjarne - just to ask, what would be the recommended way to roll back out of this once a fix is released?

@rolfbjarne
Copy link
Member

Thanks @rolfbjarne - just to ask, what would be the recommended way to roll back out of this once a fix is released?

I believe "sudo dotnet workload update" should work.

Note that the fix isn't in the service release that came out yesterday, but it should be in the next one.

@last-Programmer
Copy link

we have this issue with .net 9 rc also. will there be a fix in .net 9 rc also?

@rolfbjarne
Copy link
Member

Yes, the next RC (RC 2), will have the fix.

@velocitysystems
Copy link
Author

velocitysystems commented Sep 27, 2024

@rolfbjarne Will an SDK update be shipped that includes this and supports Xcode 15.4? Or will this only be available for Xcode 16?

@rolfbjarne
Copy link
Member

It will only be available for Xcode 16.0.

@velocitysystems
Copy link
Author

That's rather unfortunate as many of us want to stick with iOS 17 SDK until issues are ironed out with MAUI and third-party control providers such as Syncfusion and Telerik.

@mjo151
Copy link

mjo151 commented Sep 27, 2024

For what it's worth, I submitted an update to App Review with this warning and it was approved.

@MarcAlx
Copy link

MarcAlx commented Oct 4, 2024

Thanks for the update @rolfbjarne.
Open question to everyone watching this thread- has anyone pushed to the appstore with this warning, has it generated any back pressure or app review activity from Apple for you?

Just published a new app version on the store today despite the warning and no, no noticeable repercussions yet. Keeping my fingers crossed and following this issue very closely.

I double on that, it's just a warning, you can submit your app for approval. Mine was approved with no issue.

@UsherNet
Copy link

Latest build of my App using .Net 9 still generates this email response from Apple on uploading to the AppStore.

.NET SDK:
Version: 9.0.100
Commit: 59db016f11
Workload version: 9.0.100-manifests.c6f19616
MSBuild version: 17.12.7+5b8665660

Runtime Environment:
OS Name: Mac OS X
OS Version: 15.1

.NET workloads installed:
[maui-ios]
Installation Source: SDK 9.0.100

[maui-android]
Installation Source: SDK 9.0.100

@rolfbjarne
Copy link
Member

@UsherNet would you be able to provide us with the .ipa you uploaded to Apple?

@PaulUsher
Copy link

Please contact me Paul at usher dot net dot au and I can send you a link to it. I have the new one I built this morning. Apple still complain about push notification entitlements (though I'm not using any), but size of ipa is now down to 90mb from 140mb.

@janusw
Copy link

janusw commented Nov 30, 2024

For me this issue is solved by using .NET SDK version 8.0.404 / iOS workload 18.0.8314 / XCode 16.1 (and Maui 8.0.100). The warning ITMS-90078 went away with this setup.

@rolfbjarne
Copy link
Member

rolfbjarne commented Dec 5, 2024

@PaulUsher

Please contact me Paul at usher dot net dot au and I can send you a link to it. I have the new one I built this morning. Apple still complain about push notification entitlements (though I'm not using any), but size of ipa is now down to 90mb from 140mb.

Can you try adding this to your csproj to see if it fixes the issue?

<PropertyGroup>
	<MtouchExtraArgs>--optimize:register-protocols</MtouchExtraArgs>
</PropertyGroup>

Addendum: filed #21782 to fix this permanently.

@UsherNet
Copy link

UsherNet commented Dec 7, 2024

Built using Xcode 16.2 RC. Everything worked, submitted to Apple, NO warnings. Woohoo !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug If an issue is a bug or a pull request a bug fix regression The issue or pull request is a regression
Projects
None yet