I am having issue in Xcode while I try to build or archive my react-native project. Xcode throwing error like no such file or directory: '/Users/...../DerivedData/myproject/Build/Products/Debug-iphonesimulator/libReactNativeLocalization.a'
.
when I run react-native run-ios
or in release mode react-native run-ios --configuration Release
then it is working perfectly fine but when I try to build or archive it from Xcode then it is throwing error.
react-native
version is 0.57.4react-native-localization
version is 2.0.3Tried things which didn't worked for me
Removed node_modules and pods completely and run npm install
and pod install
didn't worked for me .
In menue File --> workspace setting changed build system from Use Shared System to Legacy build system. in this particular case app is build and archived successfully but when I lunch my app then it crashes after splash screen.
Removed Derived Data completely and rebuild again still getting this error.
If I remove react-native-localization
completely from my project then all the things are working fine and I am able to build and archive the project.
When we run react-native link react-native-localization
command then it also applies the changes on ios app too which creates an issue in our case. So due to this command, it creates an entry in project_name → ios → podfile (podfile)
Here ReactNativeLocalization is pointing to project_name/node_modules/react-native-localization directory due to this line when we run pod install command then there is one dependence React in this package is going to reinstall in your pods as you can see in this image.(as you can see here)
Follow the following steps to overcome form this issue
react-native link react-native-localization
command navigate to project_name → ios → podfile and remove or comment pod ‘ReactNativeLocalization’, :path => ‘../node_modules/react-native-localization’
react-native-localization
library manually from Xcode. So to link this library manually open project_name → ios → project_name.xcworksace file in Xcode and select your target.