after applying this solution we think problem is solved but while archiving in xcode 13 we get errors for RCTViewManager.h not found (i double checked the file is their). and also other anyname.h file not found error occurs so give proper or end to end solution.