Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

icon not showing #710

Closed
arctushar opened this issue Nov 12, 2017 · 21 comments
Closed

icon not showing #710

arctushar opened this issue Nov 12, 2017 · 21 comments

Comments

@arctushar
Copy link

arctushar commented Nov 12, 2017

Icon not showing, no error showing, icon installation done.

import { List, ListItem, SearchBar, Button,Avatar,Icon,SocialIcon} from "react-native-elements";

<SocialIcon

title='Some Twitter Message'
button
type='twitter'
/>

Also in node_modules\react-native-vector-icons\Fonts I have FontAwesome and other fonts
Also Android module react-native-vector-icons is already linked

emulator

@iRoachie
Copy link
Collaborator

Hey @arctushar this is usually a linking issue. Are you in a react-native init or create-react-native-app project?

@arctushar
Copy link
Author

react-native init

@omahili
Copy link

omahili commented Nov 13, 2017

As @iRoachie said it's probably a linking issue. Try this command in your project root directory:

react-native link

@xavier-villelegier
Copy link
Collaborator

Closing this as it has been inactive for a month, feel free to reopen it if it still doesn't work

@dorman99
Copy link

dorman99 commented Mar 17, 2018

i have same problem here, pls re open it. after i ejecting my app, the react native element icons doesnt work

@MaxInMoon
Copy link

MaxInMoon commented Mar 18, 2018

same with SearchBar icons (using v1.0.0-beta3)

@xavier-villelegier
Copy link
Collaborator

xavier-villelegier commented Mar 18, 2018

@dorman99 @MaxInMoon Be sure you have followed these instructions https://github.com/react-native-training/react-native-elements/issues/620#issuecomment-355530210

@MaxInMoon
Copy link

@xavier-villelegier thanks, my problem comes from the SearchBar component (#1019)

@aidooyaw1992
Copy link

this works, follow the tutorial below
https://github.com/oblador/react-native-vector-icons

@anvt96
Copy link

anvt96 commented Nov 28, 2018

I can't fix it, although I follow this link https://github.com/oblador/react-native-vector-icons. Anyone can give me solutions, please.

@ivanjzr
Copy link

ivanjzr commented Aug 14, 2019

Me to, I followed steps properly from https://github.com/oblador/react-native-vector-icons
and nothing...

@josephbuchma
Copy link

Manual installation worked for me. Copy fonts you want to use into android/app/src/main/assets/fonts and reinstall app

@7Million
Copy link

As @iRoachie said it's probably a linking issue. Try this command in your project root directory:

react-native link

This worked for me even though RN 0.60 now offers autolinking, you will have to manually do the linking because autolinking still has some issues.

@irwansyahrmd
Copy link

If you are using RN 0.60, just link it manually because the fonts assets not automatically linked by jetifier.
react-native link

@krishan-kumar-mourya
Copy link

krishan-kumar-mourya commented Oct 3, 2019

If you are using RN 0.60, just link it manually because the fonts assets not automatically linked by jetifier.
react-native link

This works, RN 0.60 or above links automatically but still for fonts assets you have to link them manually.

@siujay
Copy link

siujay commented May 16, 2022

As @iRoachie said it's probably a linking issue. Try this command in your project root directory:

react-native link

Thankyou soo much, wasted whole day on this, just had to link as you said.

@qureshi90
Copy link

Open android/app/build.gradle and add the following:

apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

This worked for me.

@AmitRathee729
Copy link

apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

Thank you so much, this worked for me

@JoaoVitorJJV
Copy link

JoaoVitorJJV commented Jul 3, 2023

Open android/app/build.gradle and add the following:

apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

This worked for me.

Worked for me

EDIT:

It worked perfectly for the build, but to release with RN 0.72 I needed to add an update patch in the node_modules/react-native-vector-icons/fonts.gradle file:

diff --git a/node_modules/react-native-vector-icons/fonts.gradle b/node_modules/react-native-vector-icons/fonts.gradle
index 5485fac..ef3ccb3 100644
--- a/node_modules/react-native-vector-icons/fonts.gradle
+++ b/node_modules/react-native-vector-icons/fonts.gradle
@@ -26,6 +26,10 @@ afterEvaluate {
 
     android.applicationVariants.all { def variant ->
         def targetName = variant.name.capitalize()
+        def lintVitalAnalyzeTask = tasks.findByName("lintVitalAnalyze${targetName}")
+        if (lintVitalAnalyzeTask) {
+            lintVitalAnalyzeTask.dependsOn(fontCopyTask)
+        }
         def generateAssetsTask = tasks.findByName("generate${targetName}Assets")
         generateAssetsTask.dependsOn(fontCopyTask)
     }
     

You can see more here: oblador/react-native-vector-icons#1508 (comment)

@usmanabid94
Copy link

Icons are now being displayed on android but not being displayed on IOS files any one faced similar issue.

@mohcenesegouat
Copy link

Open android/app/build.gradle and add the following:

apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

This worked for me.

Thank you very much, it works for me as well! 👏👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests