-
Notifications
You must be signed in to change notification settings - Fork 540
AdditionalAppExtensions: .entitlements file location - better lookup or error #19242
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
Comments
@tipa do we have any workaround of it? |
@tipa i think we must need the feature to have multiple entitlements for different build configuration. |
@qasimmajeed my .csproj looks something like this:
The |
@tipa Thanks i have done the same thing from my side and its working as expected. I am just wondering if we have the build configuration different for staging or dev environment how the entitlement will work for the same because they could have different key chain group, so is there any way that we can define the different entitlements here to pick it from the root directory basis on the build configuration? |
I'm struggling with this again today. It would be great if we could manually specify the entitlements path manually. In my case I have a widget extension that I want to share between iOS and macOS, but since it requires two different entitlement files (e.g. macOS needs sandbox entitlement while iOS doesn't), I also need to maintain two different extension projects in Xcode, in order to get two different "product names" (.appex files), one for iOS and one for macOS |
@tipa can you try changing your local version of Xamarin.Shared.targets like this: https://gist.github.com/rolfbjarne/cfe67a2735339725330549824023ddbf This should make it possible to set the |
@rolfbjarne where is that file located? Is it possible to "overwrite" the target in just my project folder (e.g. in my csproj) without having to edit files from the toolchain that might change again as I update .NET workloads? |
Adding this to the csproj might work (by overriding the existing target we ship): https://gist.github.com/rolfbjarne/637575e393f78e08a28869aa464a9361 |
I added that snippet into my csproj (as direct child of |
Can you upload a binlog of your build? |
In case someone else faces the same problem, I was able to workaround it. Instead of forcing the .NET toolchain to pick another .appex or entitlements file, I provide a
|
@tipa thank you, how do you get it signed from |
@ivmirx I have set the Entitlement in Xcode but you could probably also do that in the call to But then .NET re-signs your package when building your app (if it finds your Entitlements file!) |
A fix is in progress, which:
|
Steps to Reproduce
The last step will create a
NAME_OF_EXTENSION.entitlements
file in the folder of the extensionWhen using AdditionalAppExtensions, the documentation links to this example project where the
AdditionalAppExtensions Include
path points to the project folder, where the.xcodeproj
is located.Expected Behavior
App Group
folder).Entitlements
file is documented and/orEntitlements
file but it cannot be found and/orEntitlements
file, e.g. also looks in the extension-subfolder or searches all subfolders recursivelyActual Behavior
The app extension is not signed correctly and crashes when trying to use features granted by the entitlement.
It appears that this condition fails:
https://github.com/xamarin/xamarin-macios/blob/17523c3e4a6dc94db0731bde06eff3d01cc85cc2/msbuild/Xamarin.Shared/Xamarin.Shared.targets#L2294
The build process expects the .entitlements file to be located in the project folder, but it is located in the extension subfolder. In the build process this shows by a missing "--entitlements "path/to/entitlements" part in the
_CodesignAppBundle
step.I have encountered this problem yesterday and it took lots of time to find the cause of why the extension didn't work correctly. It appears that most developers trying to use AdditionalAppExtensions face this problem, as can be seen here.
Environment
.NET 8 RC2
The text was updated successfully, but these errors were encountered: