I have a RN 0.53.3 project that I'm building with Xcode 10.1 on AppCenter. Occasionally (but not always!) I get a build failure with the following error:
2019-03-28T19:02:56.3749050Z clang: error: no such file or directory:
'/Users/vsts/Library/Developer/Xcode/DerivedData/[...]/BuildProductsPath/Release-iphoneos/libRNI18n.a'
Comparing the build logs from a successful build with those of an unsuccessful build shows that the RNI18n library is built twice in a successful build, where the second build of the library places it in the correct place (Release-iphoneos/libRNI18n.a
):
2019-03-28T16:46:27.3954430Z === BUILD TARGET RNI18n OF PROJECT Pods WITH CONFIGURATION Release ===
2019-03-28T16:46:27.4080460Z SymLink /Users/vsts/Library/Developer/Xcode/DerivedData/[...]/BuildProductsPath/Release-iphoneos/**RNI18n/libRNI18n.a** /Users/vsts/Library/Developer/Xcode/DerivedData/[...]/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libRNI18n.a
2019-03-28T16:51:33.3477640Z === BUILD TARGET RNI18n OF PROJECT RNI18n WITH CONFIGURATION Release ===
2019-03-28T16:51:33.3633230Z SymLink /Users/vsts/Library/Developer/Xcode/DerivedData/[...]/BuildProductsPath/Release-iphoneos/**libRNI18n.a** /Users/vsts/Library/Developer/Xcode/DerivedData/[...]/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libRNI18n.a
In a failed build, the RNI18n library is only built once, and placed in a "wrong" folder (RNI18n/libRNI18n.a
):
2019-03-28T18:58:19.6561500Z === BUILD TARGET RNI18n OF PROJECT Pods WITH CONFIGURATION Release ===
2019-03-28T18:58:19.6675790Z SymLink /Users/vsts/Library/Developer/Xcode/DerivedData/[...]/BuildProductsPath/Release-iphoneos/**RNI18n/libRNI18n.a** /Users/vsts/Library/Developer/Xcode/DerivedData/[...]/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libRNI18n.a
We do use Cocoapods in our project, with the following Podfile:
Target '...' do
...
pod 'RNI18n', :path => '../node_modules/react-native-i18n'
end
I'm far from an Xcode expert and this is driving me crazy. It seems as if something might be off with the dependency on the I18n lib, which causes the build to continue without having built it.
But as far as I can tell the dependencies are configured correctly. Is it possible that I have two dependencies on the library, one through Pods and one directly, which confuses Xcode?
I faced a same problem in my project i followed these steps and it worked -
1) Select Target project
2) Under Build Phases
3) Select Target Dependencies
4) Add the missing library and compile (libRNI18n.a in your case)
Hope it works for you as well !