Adding Entitlements.plist for securestorage in maui throwing error related to Entitlements.xaml

Jose KJ 0 Reputation points
2024-10-04T11:27:43.0333333+00:00

my Entitlements.plist contents is as follows
<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

<dict>

</dict>

</plist>

in android all was working well for ios i was adding these, but its throwing this error.

Severity Code Description Project File Line Suppression State Details

Error XLS0301 Character sequence '!' was not expected at this location. MauiBlazorWeb.Maui C:\Users\JoseKJ\Desktop\jose\july\new_repo\backend\Applications\FastTrack\MauiBlazorWeb.Maui\Platforms\iOS\Entitlements.xaml 2

Severity Code Description Project File Line Suppression State Details

Error XLS0301 Character sequence '!' was not expected at this location. MauiBlazorWeb.Maui C:\Users\JoseKJ\Desktop\jose\july\new_repo\backend\Applications\FastTrack\MauiBlazorWeb.Maui\Platforms\iOS\Entitlements.xaml 2

Severity Code Description Project File Line Suppression State Details

Error XLS0303 Identifier expected. Expected a valid XAML name. MauiBlazorWeb.Maui C:\Users\JoseKJ\Desktop\jose\july\new_repo\backend\Applications\FastTrack\MauiBlazorWeb.Maui\Platforms\iOS\Entitlements.xaml 2

Severity Code Description Project File Line Suppression State Details

Error (active) MessagingRemoteException: An error occurred on client Build1728053 while executing a reply for topic xvs/build/17.2.8053/execute-task/MauiBlazorWeb.Maui/6e2ab15002fPrepareResourceRules

DirectoryNotFoundException: Could not find a part of the path "/Users/devis/Library/Caches/Xamarin/mtbs/builds/MauiBlazorWeb.Maui/6e2ab15404a143bfbcdfc7f795918dbd0fd62dd398d2a62c7622cc8b42ae0616/bin/Debug/net8.0-ios/ios-arm64/MauiBlazorWeb.Maui.app/ResourceRules.plist".

MauiBlazorWeb.Maui (net8.0-ios) C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\17.2.8053\tools\msbuild\iOS\Xamarin.Shared.targets 2309

please guide me

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,596 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 32,386 Reputation points Microsoft Vendor
    2024-10-07T05:41:34.86+00:00

    Hello,

    I noticed that you name the Entitlements file to Entitlements.xaml 2, Please make sure that you add a new XML file named Entitlements.plist to the Platforms\iOS folder of your app project.

    As you want to set securestorage, please add the keychain key like the following:

    (XXX means your App ID)

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "
    http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>keychain-access-groups</key>
    <array>
    <string>$(AppIdentifierPrefix)XXX</string>
    </array>
    </dict>
    </plist>
    
    

    For more details, please refer to iOS entitlements - .NET MAUI | Microsoft Learn

    and Secure storage - .NET MAUI | Microsoft Learn

    Best Regards,

    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.