Error -34018 is
errSecMissingEntitlement. The immediate cause of this error is that you’re trying to do something with the Security framework that requires an entitlement and your app was not signed with that entitlement. The entitlement in question is usually the
application-identifier entitlement (
com.apple.application-identifier on macOS), which is the primary mechanism by which the Security framework identifies your app.
There are two ways this error manifests:
reproducible — That is, it happens every time you run the code, typically during development but possibly in other contexts (like TestFlight or enterprise deployment).
intermittent — That is, it shows up very occasionally on user devices in the field but is otherwise hard to reproduce.
If the problem is reproducible, it’s related to how your code was signed or the context in which that code is running. There are some well-known causes for this; the most obvious one is related to a change in the iOS 10 simulator and is covered by this thread.
If you encounter reproducible -34018 errors in a context not covered by that thread, please start a new thread to discuss them.
If the problem only shows up intermittently on user devices in the field, it may be the result of a bug on iOS-based platforms. If you believe you’re hitting this bug, please follow up on this thread.
Share and Enjoy
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"