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

Trying to build a .NET for iOS binding project results in build errors with "The name '_CodeSignature' is reserved and cannot be used." #21981

Open
brunck opened this issue Jan 15, 2025 · 5 comments
Labels
binding-projects Issue or PR that affects binding projects need-attention An issue requires our attention/response
Milestone

Comments

@brunck
Copy link

brunck commented Jan 15, 2025

Apple platform

iOS

Framework version

Other

Affected platform version

.NET 8, .NET 9

Description

I created a NuGet package with .NET for iOS bindings for an .xcframework. I have to build these xcframeworks myself from source to shorten their path due to the Windows long path error in Visual Studio.

Trying to consume this package in a .NET MAUI iOS app which is then submitted to TestFlight results in errors like NSUnderlyingError = "Error Domain=IrisAPI Code=-19241 \"Asset validation failed\" UserInfo={status=409, detail=Missing or invalid signature. The bundle 'x' at bundle path 'y.framework' is not signed using an Apple submission certificate.

So assuming that the .xcframework needs to be signed first, I code-sign it after I build the xcframework.

But then trying to build the binding project (which generates the NuGet package on build) I get build errors stating "The name '_CodeSignature' is reserved and cannot be used."

Is this a bug on the .NET end, and/or do I have to somehow extract the .xcframework after building the NuGet package without code signing, code-sign, then put the NuGet package back together?

Steps to Reproduce

  1. Build .NET for iOS binding project with a code-signed xcframework native reference

Did you find any workaround?

No

Build logs

No response

@brunck brunck added the binding-projects Issue or PR that affects binding projects label Jan 15, 2025
@rolfbjarne
Copy link
Member

So assuming that the .xcframework needs to be signed first, I code-sign it after I build the xcframework.

No, the (xc)framework is signed when building the app that consumes the framework.

Trying to consume this package in a .NET MAUI iOS app which is then submitted to TestFlight results in errors like NSUnderlyingError = "Error Domain=IrisAPI Code=-19241 \"Asset validation failed\" UserInfo={status=409, detail=Missing or invalid signature. The bundle 'x' at bundle path 'y.framework' is not signed using an Apple submission certificate.

Either the framework wasn't signed at all, or it was signed using an incorrect certificate.

Can you get an MSBuild binlog for the build that produces such an error? That should show if/how the framework was signed.

@rolfbjarne rolfbjarne added the need-info Waiting for more information before the bug can be investigated label Jan 16, 2025
@rolfbjarne rolfbjarne added this to the Future milestone Jan 16, 2025
@brunck
Copy link
Author

brunck commented Jan 16, 2025

Since I'm building everything myself, and the settings are set to not sign the various frameworks that I'm building, I assume that the .frameworks are not ever signed at all. Do I need to sign those before creating xcframeworks with them?

@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 Jan 16, 2025
@brunck
Copy link
Author

brunck commented Jan 16, 2025

Here is a binlog:

msbuild.binlog.zip

@rolfbjarne
Copy link
Member

Trying to consume this package in a .NET MAUI iOS app which is then submitted to TestFlight results in errors like NSUnderlyingError = "Error Domain=IrisAPI Code=-19241 \"Asset validation failed\" UserInfo={status=409, detail=Missing or invalid signature. The bundle 'x' at bundle path 'y.framework' is not signed using an Apple submission certificate.

Which framework(s) exactly is TestFlight complaining about?

@rolfbjarne rolfbjarne added need-info Waiting for more information before the bug can be investigated no-auto-reply For internal use and removed need-attention An issue requires our attention/response labels Jan 17, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot removed the no-auto-reply For internal use label Jan 17, 2025
@brunck
Copy link
Author

brunck commented Jan 17, 2025

Error Domain=IrisAPI Code=-19241 \"Asset validation failed\" UserInfo={status=409, detail=Missing or invalid signature. The bundle 'com.datadogqh.Datadog' at bundle path 'Payload/sevendaytimer.app/ios-arm64_arm64e/DatadogCore.framework' is not signed using an Apple submission certificate.

Not sure why it's complaining about just that one.

@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 Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binding-projects Issue or PR that affects binding projects need-attention An issue requires our attention/response
Projects
None yet
Development

No branches or pull requests

2 participants