When building a React Native 0.66 project today (used to be working), there is error complaining about library not found for a module which is located at my-proj/node_modules/aliyun-oss-react-native/
. After react-native link alien-oss-react-native
and pod install
, the error remains. Some post suggests adding search path on my-proj->Building Setting->Linking
or Search Paths
. There are quite a few files under my-proj/node_modules/aliyun-oss-react-native/iOS/
, 2 questions here: 1. which path shall be added to Xcode (such as my-proj/node_modules/aliyun-oss-react-native/iOS/
)? 2. Shall the path be added to both Linking
and Search Paths
in Xcode?
Here is the screen shot of Search Paths
in Xcode:
Under TARGETS
, myproj->Build Settins, Other Linker Flags
, the module lib which causes error is listed as first one. My guess is that all libs under the Other Linker Flags
may not be recognized by Xcode. Not sure how this happens.
3
Answers
The solution works here is open the
myapp.xcworkspace
in Xcode instead ofmyapp.xcodeproj
. The build upon workspace went through without any error.Try to make search paths "recursive".
The "library not found" errors occur most of the time because installing the react-native node package and running pod install is often not enough.
The error might go away after running a clean build in xcode using the xcworkspace file. After that running "npm run ios" or "npm start" in your termal should work again.