Question

I imported RNCryptor, which can be found here: https://github.com/rnapier/RNCryptor into my app. However, I've been getting three errors with this in the log.

Undefined symbols for architecture armv7:
  "_SecRandomCopyBytes", referenced from:
      +[RNCryptor randomDataOfLength:] in RNCryptor.o
  "_kSecRandomDefault", referenced from:
      +[RNCryptor randomDataOfLength:] in RNCryptor.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I saw that this is normally caused when imported classes are not included in the target, but I have already checked the build phases, and all imported classes are in there. I do not know what is causing this, I have not touched the code of any of these classes. I have also cleaned the target several times.

Was it helpful?

Solution

Make sure to add the Security framework:

#import <Security/SecRandom.h>

OTHER TIPS

I had this issue even with the Security Framework included. I removed and re-included the framework to fix it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top