Open sandman202 opened 5 years ago
I am seeing the same error as well. Not sure why it doesnt run on iOS
The solution is in the forum here Set the iOS project's Custom Entitlements to your Entitlements.plist
iOS project => Properties => iOS Bundle Signing
@AndyDentFree I tried but it still not working
@davidortinau it may be worth doing a check not to use secure settings on the simulator with the DeviceInfo.DeviceType and just not store data as you are on a simulator :)
Just remove the existing entries in Entitlements.plist and yours. its working after that.
@navkar and @davidortinau removing "Entitlements.plist" is just solving compilation error but getting the same runtime error on iPhone Simulator what @sandman202 has reported.
As a general comment, the Xamarin toolchain seems to be back to needing frequent nuking - other problems I've had with SkiaSharp were fixed by carefully removing all bin and obj directories.
Apple have done things with XCode11 that also seem to have made accounts more fragile - I had to ensure my account details were correct in XCode11 before I could get auto-signing working for devices.
I just reviewed my changes and confirmed that this also works when compiling and running the simulators on Catalina (originally was on older Mac). I'm using XCode 11.2.1 and Visual Studio Mac 8.3.10
I have made two changes. (apologies for not taking time to do a PR - have multiple deadlines within the week)
in Xappy.iOS.csproj after the MTouchDebug element
<CodesignProvision>iOS Team Provisioning Profile: *</CodesignProvision>
<CodesignKey>iPhone Developer</CodesignKey>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
in Xappy.ios/Renderers/PageRenderer.cs fixed a startup crash due to previousTraitCollection
being null
public override void TraitCollectionDidChange(UITraitCollection previousTraitCollection)
{
base.TraitCollectionDidChange(previousTraitCollection);
var hadPrevCollection = previousTraitCollection != null;
Console.WriteLine(hadPrevCollection ?
$"TraitCollectionDidChange: {TraitCollection.UserInterfaceStyle} != {previousTraitCollection.UserInterfaceStyle}" :
$"TraitCollectionDidChange: {TraitCollection.UserInterfaceStyle} != null prior collection"
);
if (!hadPrevCollection || this.TraitCollection.UserInterfaceStyle != previousTraitCollection.UserInterfaceStyle)
{
SetAppTheme();
}
}
Removing the Entitlement.plist and commenting out the references to SecureStorage in the AppModel.cs file worked for me. The downside is the UseDarkMode setting will not be saved on the simulator
Add Custom Entitlements
Add new key to Entitlements.plist
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)com.microsoft.adalcache</string>
</array>
this solution working well for me.
Code builds fine. When I run in simulator mode, it gives.