SolvedRNCryptor Conflicting types error in Xcode 9

Seeing this error after trying to build on Xcode 9. Has anyone else had an issue like this?

RNCryptor.m:61:12: Conflicting types for 'SecRandomCopyBytes'

screen shot 2017-07-21 at 3 55 53 pm

18 Answers

✔️Accepted Answer

Replacing that line with this block seems to be a decent solution that will compile properly in Xcode 8 and 9:

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
extern int SecRandomCopyBytes(SecRandomRef rnd, size_t count, void *bytes) __attribute__((weak_import));
#else
extern int SecRandomCopyBytes(SecRandomRef rnd, size_t count, uint8_t *bytes) __attribute__((weak_import));
#endif

Other Answers:

@gregggreg That sounds like a reasonable solution. Sorry for the delay getting something out; I'll try this and push a new version this week.