CodeSign fails in Xcode for embedded framework

I was wondering if anybody has come across this issue:For the past couple of days I have been trying to embed CsoundLib64 framework (csound) in a plugin. When I am trying to build in Xcode I am getting this error:
Command CodeSign failed with a nonzero exit code and unsealed contents present in the root directory of an embedded framework. I am aware that Apple is very particular about the structure of frameworks/bundles so I deleted the static libraries at the root of the framework but I am not sure if there is something else that causes the error.