Crashing at AccountStore.Create ().Save (e.Account, "); - xamarin

In the Xamarin.Forms example ToDoAwsAuth at
https://developer.xamarin.com/guides/xamarin-forms/web-services/authentication/oauth/
After successful login, in aOnAuthenticationCompleted event, the application is crashing when trying to save to Xamarin.Auth at
AccountStore.Create ().Save (e.Account, "ToDoList");
The error says not able to say to keychain
Looking forward for help.

See if you have a file called Entitlements.plist if so click on it and check Enable Keychain
or
create a new file names Entitlements.plist with the following content then drag and drop it on your project
<?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>your bundle id</string>
</array>
</dict>
</plist>
Right click on your project
Choose Options
Choose iOS Bundle Signing
Choose Entitlements.plist
Thats all then it should be fine !

Looks like this is a bug in Xamarin.Auth as per this
https://github.com/xamarin/Xamarin.Auth/issues/128

Just add empty Entitlements.plist to your iOS app project.
Select(iOS App Project) /+ File /+ New File /+ iOS /+ Entitlements.plist
Note: this seems to be result of one bug in Xamarin.Auth and Apple's changes in iOS 10 SDK (some report bug in simulator).
Xamarin.Auth fix will be released within next few hours (CI servers) in nuget version 1.3.3-alpha-01
Similar error (bug in Xamarin.Auth) can happen if the authentication is performed while the screen is being locked. PR 80
Related:
https://github.com/xamarin/Xamarin.Auth/issues/128
https://bugzilla.xamarin.com/show_bug.cgi?id=43514
https://github.com/xamarin/Xamarin.Auth/pull/80

Related

Multiple IPA files are generated for a sliced version of app in new Xcode

With the latest Xcode, when I'm trying to create IPAs for development profile. With app thinning off, I am getting one universal IPA file as expected. But when I enable app thinning and select a specific device, I am getting multiple IPA files. With older Xcodes (10.1) I still get only one thinned IPA file as expected
Did any one else ran into this issue? Is there any solution for this?
This is the ExportOptions plist file
<?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>compileBitcode</key>
<true/>
<key>destination</key>
<string>export</string>
<key>method</key>
<string>development</string>
<key>signingStyle</key>
<string>automatic</string>
<key>stripSwiftSymbols</key>
<true/>
<key>teamID</key>
<string><teamIDHere></string>
<key>thinning</key>
<string>iPhone9,1</string>
</dict>
</plist>
With older Xcodes (10.1) I still get only one thinned IPA file as expected
So let’s ask ourselves: what happened in Xcode 10.2? Answer: ABI stability! So the app can be thinned in two different ways, depending whether the target device has Swift built into the system frameworks or not. And you can tell the difference; one thinned app will be larger because it contains the Swift frameworks.

Why can't the api health kit connect to com.apple.healthkit?

I am collecting an app that should be able to get data from the ios Health app
Included in the application id the HealthKit feature, added nativescript-health-data plugin
When running for debugging via usb, Error "Domain = com.apple.healthkit Code = 4" Missing com.apple.developer.healthkit entitlement. is written to the log, when trying to authorize and download data, nothing happens.
Has anyone come across this?
I found a mention that this problem can be solved via xcode, but I don’t understand how to open the application in it.
You will have to enable HealthKit capability on your application identifier at developer portal. You might have to download the updated provisional profiles too.
Create an entitlements file with your app name (${YourAppName}.entitlements) at /App_Resources/iOS and paste the content below.
<?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>com.apple.developer.healthkit</key>
<true/>
<key>com.apple.developer.healthkit.access</key>
<array/>
</dict>
</plist>
Now open /App_Resources/iOS/build.xcconfig and add this line,
CODE_SIGN_ENTITLEMENTS = ${YourAppName}/${YourAppName}.entitlements
Replace ${YourAppName} with your app name, now try a clean build.

Mac App Store Rejection - App sandbox not enabled

I've submitted my app to the Mac App Store and it validated fine. However, I keep getting Invalid Binary messages with the following;
App sandbox not enabled - The following executables must include the "com.apple.security.app-sandbox" entitlement with a Boolean value of true in the entitlements property list. Refer to the App Sandbox page for more information on sandboxing your app.
This is despite having the entitlements enabled in the app (both the app and the helper) with the following contents;
<?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>com.apple.security.app-sandbox</key>
<true/>
</dict>
</plist>
Not sure what to check next.
Okay, solved this one myself and posting here for completeness. It would seem that despite the existence of the entitlement file in the project, unless the app is codesigned it will not recognise the sand box entitlement. This is even though the app validates successfully.
I had the same error message, but for me the problem was the fact that I forgot to sign the app.
I tracked down the problem to the Build Settings, Signing, CODE_SIGN_ENTITLEMENTS had multiple values. The values looked all the same, so I just re-entered the path for the entitlement file, the multiple values went away, and I no longer got the Sandbox not enabled error.

app sandbox container-migration.plist doesn't move files

I have set up my container-migration.plist and rechecked it many times. My signing certificates are all ok and the old app plist is migrated automatically to the container of the new sandboxed app as it should. I have support files in the old app's ~Application Support/Birthdaybook folder and they are not being migrated on first launch of sandboxed app to the new container.
I remove the new container com.robdutoit.birthdayBook each time before testing to trigger the migration. The new container gets created with the app plist in Preferences but the Birthdybook folder is not moved to the Application Support folder in the new container. As suggested in previous post, I tried copying the sandboxed app to the desktop but migration does not work from there either. I have spent days on this and app is ready for submission except for this roadblock. Any help appreciated.
<?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&gt
<key>Move</key>
<array>
<string>${ApplicationSupport}/Birthdaybook</string>
</array>
</dict>
</plist>
Check Console.app logs. Filter it by your app name. The issue, if any, should be in there. Other than that double check the paths your are using.

Xcode 4.1 Code Signing Issue

I've read through many threads and can't find anything like my issue here. I think that this is a simple fix, but I just can't seem to find the answer. I'm using Xcode 4.1 Gold Master.
Basically, when I archive my Mac app, it goes through all the normal processes. The build is successful. However, when I submit to the app store, I get the following message back:
Invalid Code Signing Entitlements - Your application bundle's signature contains code
signing entitlements that are not supported on Mac OS X; this may happen if your Mac OS X
project was ported from iOS. Please check your Xcode project's code signing entitlements
configuration, and remove any unneeded entitlements.
Specifically, key "application-identifier" in "My App" is not supported.
My app was not ported from iOS and I have never setup entitlements. After many hours of digging, I found that the code sign phase was generating an .xcent file in this format:
<?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>application-identifier</key>
<string>My.App.Identifier</string>
<key>com.apple.application-identifier</key>
<string>My.App.Identifier</string>
</dict>
</plist>
The first key is the one causing the problem. When I remove that and force resign the app with the same .xcent file through the command line, then the app goes through.
I've removed and reinstalled xcode to see if that helps...it doesn't.
I know this file creation is tied to the provisioning profile. It seems to be getting the right data, but adding that existing tag. I've checked both the project and build settings and there are no code signing entitlements at all. Any idea how I can get Xcode to stop generating this key? I'm not really fond of doing this every time I want to submit to the app store.
I face the same problem. After reading your message I investigated a little bit.
It looks like during the building process the .xcent file is generated from the file located at /Developer/Platforms/MacOSX.platform/Entitlements.plist (it may also be located in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Entitlements.plist).
I edited this file and replaced "application-identifier" by "com.apple.application-identifier".
So now the .xcent file contains only:
<?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>com.apple.application-identifier</key>
<string>33R9UFHX3C.com.mycompany.myapp</string>
</dict>
</plist>
However I still face a invalid binary error when I build and upload it.
EDIT: it actually works. (I had another non-related issue)

Resources