Mobile 개발/RN(React Native)

react-native-vector-icon 깨짐 해결

히핑소 2021. 8. 12. 17:59
반응형

device 에서 react-native-vector-icon 적용 시, 깨지는 경우 해결 방법입니다.

(사실 무지 간단합니다.)

 

- Android

android/app/build.gradle 에 아래 한줄 추가한 후 재 빌드 하면 해결

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

 

만약, gradlew clean 후에 깨지는 현상이라면 아래 참조하세요

 

RN TroubleShooting: gradlew clean 후 react-native-vector-icons 깨짐

gradlew clean 하고나서 android vector-icon 이 모두 깨지는 문제가 발생하여 정리합니다. react-native link 한줄이면 해결됩니다. github.com/oblador/react-native-vector-icons/issues/1117 cannot load icon..

yannichoongs.tistory.com

 

- IOS

add code to

ios/AppName/Info.plist

	<key>UIAppFonts</key>
	<array>
		<string>AntDesign.ttf</string>
		<string>Entypo.ttf</string>
		<string>EvilIcons.ttf</string>
		<string>Feather.ttf</string>
		<string>FontAwesome.ttf</string>
		<string>FontAwesome5_Brands.ttf</string>
		<string>FontAwesome5_Regular.ttf</string>
		<string>FontAwesome5_Solid.ttf</string>
		<string>Fontisto.ttf</string>
		<string>Foundation.ttf</string>
		<string>Ionicons.ttf</string>
		<string>MaterialCommunityIcons.ttf</string>
		<string>MaterialIcons.ttf</string>
		<string>Octicons.ttf</string>
		<string>SimpleLineIcons.ttf</string>
		<string>Zocial.ttf</string>
	</array>

xcode 에서 아래와 같이 나와야 하니 참고하세요.

반응형