Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting unknown error about "dynamic accessors failing" after updating to macOS

After upgrading to macOS Sierra (10.12) and Xcode 8.0 (8A218a), I began getting many error messages in my macOS/Cocoa app (written in Objective-C) that follow this format:

[error] warning: dynamic accessors failed to find @property implementation for 'uniqueId' for entity ABCDInfo while resolving selector 'uniqueId' on class 'ABCDInfo'.  Did you remember to declare it @dynamic or @synthesized in the @implementation ?

[error] warning: dynamic accessors failed to find @property implementation for 'uniqueId' for entity ABCDContact while resolving selector 'uniqueId' on class 'ABCDContact'.  Did you remember to declare it @dynamic or @synthesized in the @implementation ?

[error] warning: dynamic accessors failed to find @property implementation for 'uniqueId' for entity ABCDEmailAddress while resolving selector 'uniqueId' on class 'ABCDEmailAddress'.  Did you remember to declare it @dynamic or @synthesized in the @implementation ?

[error] warning: dynamic accessors failed to find @property implementation for 'address' for entity ABCDEmailAddress while resolving selector 'address' on class 'ABCDEmailAddress'.  Did you remember to declare it @dynamic or @synthesized in the @implementation ?

None of this is my code or code from 3rd party developer libraries that I'm using, and doing a search on those variable names (i.e: 'uniqueId' or 'ABCDInfo') does not pull anything up, indicating it's not in my project.

I saw that this issue was also reported on Apple's Developer Forums twice (Issue 1 and Issue 2), but both questions remain unanswered

My question is: What causes these error messages and how can I fix them? It doesn't cause my app to crash, but I'd rather figure out and understand what's wrong.

like image 474
Ryan D'souza Avatar asked Sep 28 '16 01:09

Ryan D'souza


2 Answers

First of all let´s check what @synthesize and @dynamic are:

  • @synthesize will generate getter and setter methods for your property
  • @dynamic tells the compiler that the getter and setter methods are implemented not by the class itself but somewhere else (like the superclass or will be provided at runtime)

Contacts now requires that anyone using mail/contact framework needs to be codesigned with the uses-contacts entitlement.

You need to sandbox your app by granting the "Contacts access" entitlement. The warnings will still be logged, but this is linked to another bug of XCode 8 that logs so many things uselessly.

It seems Apple will no longer accept non sandboxed app to access the Contacts (or location or calendar).

To sandbox your app do the following: Go to your project settings > Select your app > Enable App SandBox and then select the App data that you´re using.

like image 121
Rashwan L Avatar answered Nov 10 '22 00:11

Rashwan L


Maybe related to this configuration:

  • You are accessing AddressBook framework, probably built with 'implicit synthesized properties' ON.
  • You software is built with 'implicit synthesized properties' OFF
like image 37
Antoine Rosset Avatar answered Nov 10 '22 01:11

Antoine Rosset