First, thanks for the great work on this project.
On a brand new RN project, the instructions for react-native-vector-icons work great and it installs without issues.
However, when I add a new Build Configuration in Xcode and then try to build using that configuration, I get
ld: library not found for -lRNVectorIcons
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I must be missing something obvious, but I can't figure out what it is.
Steps to reproduce:
react-native init Foocd Foonpm install react-native-vector-icons --savernpm linkDebug configuration.
Debug copy
Any help would be greatly appreciated. If the issue isn't related to react-native-vector-icons, feel free to close. Thanks!
It's not really an RNVI issue like you say, but try to switch the order of steps 4 and 5.
Yes, I tried switching the order of steps 4 and 5, and it did not help.
After further research, the problem seems to be described here:
I still haven't found a good solution, but I guess I will just live with the standard "Release" and "Debug" configurations for now.
I personally use 5 different build configs without any problems, but then I'm using CocoaPods so my setup differs slightly.
Could you please provide example link for build configuration.
If you want to add new Staging configuration you can add line:
"$(BUILD_DIR)/Release$(EFFECTIVE_PLATFORM_NAME)",
in LIBRARY_SEARCH_PATHS for your new configuration in project.pbxproj file
Just to remember - sometimes need to close and open XCode to see this changes.
And build will be successful!
That happens because build command put libraries into /Build/Products/Release-iphonesimulator/ folder
And for your new configuration it searches libs into /Build/Products/Staging-iphonesimulator/ folder
So can't find them and we need to declare library search path manually to point to release folder.
Thanks @philipshurpik. This worked for me, with the same problem in a different project. I wrote up the steps (with screenshots) in this StackOverflow post:
xcode 8.3.2 needs a bit different changes.
to make it work, you need to change the Pre-configuration Build Products Path for your custom build config. for example, i have an Internal build config. in that field, instead of $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) i put $(BUILD_DIR)/Release$(EFFECTIVE_PLATFORM_NAME), and now it works :)
And don't forget to make "react-native link" after @pvinis action. I use react-native-lock and it has pods. If you don't link libraries again Xcode won't be able to find their pathes:)
Unfortunately it still doesn't work for Archive :-/
Most helpful comment
If you want to add new Staging configuration you can add line:
"$(BUILD_DIR)/Release$(EFFECTIVE_PLATFORM_NAME)",
in LIBRARY_SEARCH_PATHS for your new configuration in project.pbxproj file
Just to remember - sometimes need to close and open XCode to see this changes.
And build will be successful!
That happens because build command put libraries into /Build/Products/Release-iphonesimulator/ folder
And for your new configuration it searches libs into /Build/Products/Staging-iphonesimulator/ folder
So can't find them and we need to declare library search path manually to point to release folder.