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

Unrecognized font family 'Ionicons' #1169

Closed
semnyqu opened this issue Apr 27, 2020 · 3 comments
Closed

Unrecognized font family 'Ionicons' #1169

semnyqu opened this issue Apr 27, 2020 · 3 comments

Comments

@semnyqu
Copy link

semnyqu commented Apr 27, 2020

Project develop environment package.json file:
"react": "16.11.0",
"react-native": "0.62.2",
"react-native-vector-icons": "^6.6.0",

Class import:
import Icon from 'react-native-vector-icons/Ionicons';

IDE:
Xcode11.2.1
VSCode 1.44.2

Debug iOS in VSCode
Log:Unrecognized font family 'Ionicons'
image

@RaphaelHadjadj
Copy link

I got that issue with exactly the same configuration as you.
Loading it manually worked for me.
"react-native-vector-icons": "6.6.0",
"react-native": "0.62.2",
"react": "16.11.0",

import Ionicons from 'react-native-vector-icons/Ionicons'

export default () => {

    const [loaded, setLoaded] = useState(false);

    useEffect(() => {
        (async () => {
            await Ionicons.loadFont();
            setLoaded(true);
        })();
    }, []);
    
    return loaded && <App />
}

@nelsonprsousa
Copy link

Just go to ios/YourAppName/Info.plist and add:

(...)
<dict>
	<key>UIAppFonts</key>
	<array>
		<string>Ionicons.ttf</string>
	</array>
	(...)
</dict>
`

@tonaldghost
Copy link

SOLUTION
This is how you fix the error. Don't go mental like I did for 30 minutes. Simply resolve the issue by editing the info.plist, adding the font files like it says in docs here: https://github.com/oblador/react-native-vector-icons
Search for plist and add the Key and Array of all the strings.

@johnf johnf closed this as completed Aug 5, 2023
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

5 participants