Is your feature request related to a problem? Please describe.
React native vector icons is one of the few libraries that isn't linking automatically. I followed the instructions using CocoaPods option and got the following error after run the app:
error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:
react-native-vector-icons (to unlink run: "react-native unlink react-native-vector-icons")
This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward, you can unlink this dependency via "react-native unlink" and it will be included in your app automatically. If a library isn't compatible with autolinking, disregard this message and notify the library maintainers.
I was just expecting this if I followed the react native link option.
Describe the solution you'd like
Autolinking. The current solution seems to link but then I need to unlink 🤷‍♂️
Additional context
I've ran react-native unlink react-native-vector-icons and the line that I added on my Podfile got deleted. After that, the app still runs.
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
Hi Nelson,
I had similar problem, but i didn't link react-native-vector-icons because it doesn't change nothing, unfortunately.
now the problem is react-native don't recognize font 'FontAwesome' kkkkkk
I also didn't link, just followed the CocoaPods options, but everytime I run the app, the error appears. 🤷‍♂️
Let's see if some maintainer know what's happening 👍 If you guys need something just give me a heads up 👍
+1
Same issue here

why i get this error event after following all the steps for linking the library
why i get this error event after following all the steps for linking the library
Posted the solution here:
https://github.com/oblador/react-native-vector-icons/issues/1169#issuecomment-626416058
same issue here
+1 Same issue here
Run below commands to solve this issue.
npx react-native link
npx react-native unlink react-native-vector-icons
Run below commands to solve this issue.
npx react-native link
npx react-native unlink react-native-vector-icons
Why link and unlink right after? 🤔
Run below commands to solve this issue.
npx react-native link
npx react-native unlink react-native-vector-iconsWhy link and unlink right after? 🤔
I am not sure exactly why. But when I follow these steps its working..
Run below commands to solve this issue.
npx react-native link
npx react-native unlink react-native-vector-iconsWhy link and unlink right after? 🤔
I am not sure exactly why. But when I follow these steps its working..
try to install the pods and the project will fail.
cd ios && pods install
This is really puzzling issue! I have the same issue.
@bkh2js Please try my approach.. That is working..
Run npx react-native link && npx react-native unlink react-native-vector-icons
@bkh2js : Please tell me your issue in details. I will try to answer.
We are trying to get some workarounds for a main problem. And the workaround was reported in the first message (the issue): everything works after the unlink.
The problem is, why should we link to unlink right after? Shouldn't the autolinking be working after 0.60? @oblador do you have any idea or what's causing the autolinking to not work as expected?
@sangameshrently @NelsonPRSousa solution seems to work.
@sangameshrently I'm trying it...
but in every time i got this error when Build
Multiple commands produce '/Users/anas/Library/Developer/Xcode/DerivedData/myApp-dgyemahaekpmtsewexlythyooogi/Build/Products/Debug-iphonesimulator/myApp.app/AntDesign.ttf':
1) Target 'myApp' (project 'myApp') has copy command from '/Volumes/Work/Works/QiamApp/node_modules/react-native-vector-icons/Fonts/AntDesign.ttf' to '/Users/anas/Library/Developer/Xcode/DerivedData/myApp-dgyemahaekpmtsewexlythyooogi/Build/Products/Debug-iphonesimulator/myApp.app/AntDesign.ttf'
2) That command depends on command in Target 'myApp' (project 'myApp'): script phase “[CP] Copy Pods Resources”
@sangameshrently I'm trying it...
but in every time i got this error when Build
Multiple commands produce '/Users/anas/Library/Developer/Xcode/DerivedData/myApp-dgyemahaekpmtsewexlythyooogi/Build/Products/Debug-iphonesimulator/myApp.app/AntDesign.ttf':
1) Target 'myApp' (project 'myApp') has copy command from '/Volumes/Work/Works/QiamApp/node_modules/react-native-vector-icons/Fonts/AntDesign.ttf' to '/Users/anas/Library/Developer/Xcode/DerivedData/myApp-dgyemahaekpmtsewexlythyooogi/Build/Products/Debug-iphonesimulator/myApp.app/AntDesign.ttf'
2) That command depends on command in Target 'myApp' (project 'myApp'): script phase “[CP] Copy Pods Resources”
Sorry I am not getting you.
@sangameshrently I'm trying it...
but in every time i got this error when Build
Multiple commands produce '/Users/anas/Library/Developer/Xcode/DerivedData/myApp-dgyemahaekpmtsewexlythyooogi/Build/Products/Debug-iphonesimulator/myApp.app/AntDesign.ttf':
1) Target 'myApp' (project 'myApp') has copy command from '/Volumes/Work/Works/QiamApp/node_modules/react-native-vector-icons/Fonts/AntDesign.ttf' to '/Users/anas/Library/Developer/Xcode/DerivedData/myApp-dgyemahaekpmtsewexlythyooogi/Build/Products/Debug-iphonesimulator/myApp.app/AntDesign.ttf'
2) That command depends on command in Target 'myApp' (project 'myApp'): script phase “[CP] Copy Pods Resources”
Sorry I am not getting you.
After Linking the lib I couldn't build the app and I got this error in Xcode Logs
@anastely : You have to link then unlink.. it will work . Read my previous comments in same post.
@sangameshrently Yes, that's what I was doing but it does not work for me sadly.
@anastely oh. Can you try manually deleting font names from info Plist
@sangameshrently Same...
I'm on:
react-native: 0.60.6
react-native-vector-icons: 6.6.0
What worked for me was running npx pod-install, which you can see in the output detects the Podfile:
Detected React Native module pods for RNVectorIcons, BugsnagReactNative, RNCAsyncStorage, RNCPushNotificationIOS, RNGestureHandler, react-native-image-picker, react-native-intercom, react-native-netinfo, react-native-pusher-push-notifications, react-native-splash-screen, react-native-video, and react-native-webview
Then, add the font assets to your Info.plist but make sure your App.xcodeproj does not contain references to them,
I did not run the link/unlink commands as others have said here, nor did I need to add RNVectorIcons to my project's Podfile directly.
Also, make sure you clean your build folder + yarn start --reset-cache (aka 🔥 it all down) before building.
Well for me the linking and unlinking solution made it not crash every time the app is reloaded but for some reason i only get a ? icon the icons never appears.
Well for me the linking and unlinking solution made it not crash every time the app is reloaded but for some reason i only get a ? icon the icons never appears.
Instead of running the commands, manually add the icon files to your Info.plist
Tried it, but when I do that the app just stays in the "Feather" not found error and not even reloading does the trick.
Tried it, but when I do that the app just stays in the "Feather" not found error and not even reloading does the trick.
And you ran pod install and saw the package listed in the output?
And you restarted your watchman?
yarn start —reset-cache
I delete all my pods.
Then ran xcodebuild clean inside de iOS.
Re-installed all my pods where i got:
Auto-linking React Native modules for targetAntroAv: BVLinearGradient, RNCMaskedView, RNGestureHandler, RNReanimated, RNScreens, RNVectorIcons, RealmJS, and react-native-safe-area-context
Uninstalled the app from my simulator.
Ran yarn ios and on another tab yarn start —reset-cache
When the app opened I got this:

Then when I save a file and the app reloads it loads but the icons doesn't show:

I get the same Error above when I change the name of the icon.
Edit:
Just to add a little bit more of confusion I also tried changing the import to material icons and trying a different icons:

And got this:

@vinibiso Mmk and you said you added them to your Info.plist.
Did you check:
“ensure that they also appear under Copy Bundle Resources in Build Phases.”
@evanb2 So i checked it out and i wasn't.
So I did that section again.
And I had the
Build system information
error: Multiple commands produce '/Users/vinicius/Library/Developer/Xcode/DerivedData/AntroAv-cabktmpcoouhuqbirxunajjpegko/Build/Products/Debug-iphonesimulator/AntroAv.app/Feather.ttf':
1) Target 'AntroAv' (project 'AntroAv') has copy command from '/Users/vinicius/Documents/projects/AntroAv/node_modules/react-native-vector-icons/Fonts/Feather.ttf' to '/Users/vinicius/Library/Developer/Xcode/DerivedData/AntroAv-cabktmpcoouhuqbirxunajjpegko/Build/Products/Debug-iphonesimulator/AntroAv.app/Feather.ttf'
2) That command depends on command in Target 'AntroAv' (project 'AntroAv'): script phase “[CP] Copy Pods Resources”
And yes I reisntalled pods and did everything I did before.
So i manually eddited the project.pbxproj file and removed de duplicate.
The build worked, but still the same problems as reported earlier.
Icons don't show up.
It's very weird. But maybe I'm still doing something wrong.
This was the only thing that worked for me!
Run below commands to solve this issue.
npx react-native link
npx react-native unlink react-native-vector-icons
I am on react-native-vector-icons 7.0.0 and react-native 0.63.2
Not sure if this means that I am now "unlinked" but it works and I've spent 2hrs trying to figure this stupid thing out, so I'm just going with it.
This was the only thing that worked for me!
Run below commands to solve this issue.
npx react-native link
npx react-native unlink react-native-vector-iconsI am on react-native-vector-icons 7.0.0 and react-native 0.63.2
Not sure if this means that I am now "unlinked" but it works and I've spent 2hrs trying to figure this stupid thing out, so I'm just going with it.
Solved to me
I think this is happening because there is a resources line in the .podspec AND an assets line in react-native.config.js. I think it's causing the font files to be copied twice when auto linking occurs, so removing one of these should solve the problem.
cd ios && pods install
it's not pods install, It's pod install
I have solved this instead of unlinking the package removing all the .ttf resources from Build Phases -> Copy Bundle Resources and then running the application.
Most helpful comment
This was the only thing that worked for me!
I am on react-native-vector-icons 7.0.0 and react-native 0.63.2
Not sure if this means that I am now "unlinked" but it works and I've spent 2hrs trying to figure this stupid thing out, so I'm just going with it.