iOS app throws -34018 on Mac after updating to Ventura/Xcode 14.1

Hello,

before updating to MacOS Ventura (13.0.1) and Xcode 14.1 I was perfectly able to run a iOS application from Xcode on my Mac (so "My Mac (Designed for iPad)" is selected as a target). After these updates I can't access the keychain anymore, the following error is shown:

OSStatus error: [-34018] Security error has occurred.

In the console I see

Entitlement com.apple.application-identifier=TEAM.com.NAME.APP is ignored because of invalid application signature or incorrect provisioning profile

Entitlement com.apple.security.application-groups=(
    "group.com.NAME.APP"
) is ignored because of invalid application signature or incorrect provisioning profile

App[76770]/1#8 LF=0 copy_matching Error Domain=NSOSStatusErrorDomain Code=-34018 "Client has neither com.apple.application-identifier nor com.apple.security.application-groups nor keychain-access-groups entitlements" UserInfo={numberOfErrorsDeep=0, NSDescription=Client has neither com.apple.application-identifier nor com.apple.security.application-groups nor keychain-access-groups entitlements}

Checking the created *.app file with codesign -d --entitlements results in:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
	<dict>
		<key>application-identifier</key>
		<string>TEAM.com.NAME.APP</string>
		<key>aps-environment</key>
		<string>development</string>
		<key>com.apple.developer.team-identifier</key>
		<string>TEAM</string>
		<key>com.apple.developer.usernotifications.communication</key>
		<true/>
		<key>com.apple.security.application-groups</key>
		<array>
			<string>group.com.NAME.APP</string>
		</array>
		<key>get-task-allow</key>
		<true/>
	</dict>
</plist>

So, the application identifier is actually there, as is the application-group. When I install the latest version of the app from the App Store, everything is working fine. Running the app on a real iOS device also works perfectly fine from Xcode, it's just running on Mac which isn't working properly.

Has something changed with Ventura or Xcode 14.1? Any idea what I can do/try?

After these updates I can't access the keychain anymore

If you create a new app from one of the built-in templates, does it have the same problem?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I'm seeing the same thing, when I start a new app from a template:

2022-11-14 16:08:34.408009+0100 KeychainTest[23016:1864774] OSStatus error: [-34018] Security error has occurred.
2022-11-14 16:08:34.408167+0100 KeychainTest[23016:1864774] OSStatus error: [-34018] Security error has occurred.
No string returned

My test code was like:

        let keychain = UICKeyChainStore.init(service: "de.NAME.APP", accessGroup: "group.de.NAME.APP")

        keychain.setString("ABC", forKey: "MyKey")
        let testString = keychain.string(forKey: "MyKey")

        if let testString = testString {
            print("Returned string: " + testString)
        } else {
            print("No string returned")
        }

(using this lib: https://github.com/kishikawakatsumi/UICKeyChainStore)

To rule out any problem with the lib, I tried the code found at https://stackoverflow.com/a/42360846:

        let test = "ABC"
        let data = test.data(using: .utf8)

        if let data = data {
            KeyChain.save(key: "MyKey", data: data)
            let keyChainData = KeyChain.load(key: "MyKey")

            if keyChainData != nil {
                print("Data was returned")
            } else {
                print("No data returned")
            }
        }

Same error, with this one, so basically the app logs

2022-11-14 16:24:18.381452+0100 KeychainTest[24118:1904070] OSStatus error: [-34018] Security error has occurred.
2022-11-14 16:24:18.381605+0100 KeychainTest[24118:1904070] OSStatus error: [-34018] Security error has occurred.
No string returned
No data returned

Running the same on a real device, it works:

Returned string: ABC
Data was returned

In the console I see the same messages about about entitlement and provisioning profile as in the first message.

I’m not entirely sure what’s going on here, and I don’t alas have the time today to dig any deeper, but this certainly sounds like a bug to me. I encourage you to file it as such. I recommend that you file the bug against Xcode, not macOS 13, and attach the test project you created from the built-in templates.

Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Hello Quinn,

thanks for your help! I filed it as recommended under FB11793487. I also tried to run it with Xcode 14.0 - same problem.

Thanks!

getting same issue

any progress? same problem for ios app on Mac Ventura 13.1 (Xcode 14+), work fine for Mac OS 12.x

Another developer opened a DTS tech support incident about a similar issue, allowing me the opportunity to dig into this in detail. It’s very likely that your issue is caused by the same underlying bug. This isn’t fixed in the latest macOS 13.2 beta seed (22D5027d). As always, I encourage you to re-test with beta seeds as they’re released.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Hey Quinn,

looks like this is resolved for me in 13.2 Beta (22D5038i)! So I guess you got to the bottom of this?

Thank you!

iOS app throws -34018 on Mac after updating to Ventura/Xcode 14.1
 
 
Q