NativeBase icon indicating copy to clipboard operation
NativeBase copied to clipboard

Icons is not showing

Open nameer94 opened this issue 7 years ago • 21 comments

Icons is not showing it shows something like this ▯ only. react-native: 0.60.4 native-base: 2.12.2 I tried npm install --save react-native-vector-icons but nothing changed :/

nameer94 avatar Jul 24 '19 11:07 nameer94

same issues with 2.12.3

dl-husky73 avatar Jul 24 '19 17:07 dl-husky73

Same problem with

    "native-base": "^2.13.0",
    "react": "16.8.3",
    "react-native": "0.59.10",
    "react-native-navigation": "2.25.0",
    "styled-components": "^4.3.2"

I tried FontAwesome and AntDesign, both just showing the X. I'm running in Android Simulator.

mwq27 avatar Jul 25 '19 11:07 mwq27

Same Issue with: "native-base": "^2.12.2", "react": "16.8.6", "react-native": "0.60.4",

hectorthiele avatar Jul 26 '19 00:07 hectorthiele

I found the solution https://github.com/oblador/react-native-vector-icons/issues/661#issuecomment-378546936

just add this code to app/build.gradle apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

nameer94 avatar Jul 27 '19 10:07 nameer94

Same Issue with: "native-base": "^2.12.2", "react": "16.8.6", "react-native": "0.60.4",

I've fixed it with copying fonts manually oblador/react-native-vector-icons#661 (comment)

kaminaly avatar Jul 31 '19 07:07 kaminaly

@nameer94's solution worked for me.

mwq27 avatar Jul 31 '19 11:07 mwq27

At this moment, auto linking for react-native-vector-icons in react native 0.60 isn't working. You can copy the fonts manually or here's another solution that worked for me:

1.) Uninstall react-native-vector-icons using npm or yarn

npm uninstall react-native-vector-icons --save

2.) cd into your ios folder and rerun pod install

cd ios
pod install
cd ../

3.) Reinstall react-native-vector-icons using npm or yarn and link the icons manually

npm install react-native-vector-icons --save
react-native link react-native-vector-icons

4.) Restart your simulators for good measure and rerun your app

react-native run-ios
react-native run-android

tomchomiak avatar Aug 03 '19 08:08 tomchomiak

Hope this resolves the issue. Feel free to create a new issue if the issue persists. Also check out our latest release v2.12.5.

Thank you!

PlabanJr avatar Aug 16 '19 14:08 PlabanJr

@PlabanJr This issue still persists on 2.13.5. I think this issue came when you did refactor deprecated lifecycle methods. In IconNB.js

componentDidUpdate(nextProps) {
    if (nextProps.type && this.props.type !== nextProps.type) {
      this.setIcon(nextProps.type);
    }
  }

should be

componentDidUpdate(prevProps) {
    if (prevProps.type && this.props.type !== prevProps.type) {
      this.setIcon(this.props.type);
    }
  }

Please correct if I am wrong.

r0b0t3d avatar Aug 26 '19 09:08 r0b0t3d

I confirm that react-native-vector-icons is not working in auto-linking mode for react-native 0.61.1. In addition to @tomchomiak answer, you have to create react-native.config.js file with the following content:

module.exports = {
  dependencies: {
    'react-native-vector-icons': {
      platforms: {
        android: null
      }
    }
  }
};

khasky avatar Sep 29 '19 11:09 khasky

@khasky where to create that file??

mufaddalhamidofficial avatar Jan 01 '20 13:01 mufaddalhamidofficial

@mufaddalhamidofficial In the root folder of your app

danlupascu avatar Jan 01 '20 13:01 danlupascu

what about expo... @khasky will this work with expo

mufaddalhamidofficial avatar Feb 24 '20 12:02 mufaddalhamidofficial

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

Its worked for me

andresteje avatar Apr 04 '20 05:04 andresteje

I found the solution oblador/react-native-vector-icons#661 (comment)

just add this code to app/build.gradle apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

this worked for me, Thanks !

ramanasak avatar Aug 24 '20 13:08 ramanasak

I found the solution oblador/react-native-vector-icons#661 (comment)

just add this code to app/build.gradle apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

It's working Guys. thanks.

ajaymarathe9 avatar Oct 19 '20 07:10 ajaymarathe9

I found the solution oblador/react-native-vector-icons#661 (comment) just add this code to app/build.gradle apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

It's working Guys. thanks.

Yep, this solution worked for me.

zanotta avatar Oct 26 '20 16:10 zanotta

apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" wasn't working for me.

I had to copy all the font files from node_modules/native-base/Fonts to android/app/src/main/assets/fonts.

AdrianMrn avatar Nov 03 '20 08:11 AdrianMrn

Had the same problem with native-base v2.15.0 and these dependencies: "react": "16.13.1" "react-native": "0.63.4"

Adding this code mentioned up there apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" in android/app/build.gradle solved it!

Milutin-P avatar Dec 29 '20 09:12 Milutin-P

I found the solution oblador/react-native-vector-icons#661 (comment)

just add this code to app/build.gradle apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

This works for me! Thanks @nameer94

KennedyKeinstein avatar Jan 13 '21 15:01 KennedyKeinstein