Why does React Native linking lead to workspace integrity error?

1k views Asked by At

I have troubles with the development of a React Native app.

I have developed a native module and a native ui component.

Finally, I would like to publish both as a NPM module.

However, when I tried to integrate the native module and the native ui as NPM package into a (new) React Native app (for example created with react-native init command), I first got the following error Invariant Violation requireNativeComponent ComponentName was not found in UIManager. According to some GitHub issues this might be a problem with missing linking.

So I decided to run react-native link. However, by doing this the situation got even worse, because from that point on I got the following error Workspace Integrity Error - Couldn't load project for all the RCT libraries.

Error messages

I already followed the instructions of other Stackoverflow posts regarding that topic, which describe how to investigate the .pbxproj file. Further, I tried to reinstall the pods of my npm package. Finally, I ensured that I use the .xcworkspace file and not the .xcodeproj file.

However, the errors still persist.

1

There are 1 answers

0
Programmer_Bee On

Worked for me by

  • opening a new .xcworkspace file
  • clean project
  • Pressing on "Build and run the current scheme"