oblador / react-native-vector-icons

Customizable Icons for React Native with support for image source and full styling.
https://oblador.github.io/react-native-vector-icons/
MIT License
17.31k stars 2.12k forks source link

TvOS failed to find font #1626

Closed stdiodavid closed 2 weeks ago

stdiodavid commented 2 weeks ago

Environment

MacOS 14.3.1 Xcode 15.4 TvOS 17.5

Description

I created the project from https://github.com/react-native-tvos/react-native-tvos yarn create react-native-app TestApp --template https://github.com/react-native-tvos/react-native-template-typescript-tv/tree/tv-release-0.74.0 --template-path template

And try to use the monorepo branch to handle the icon

npm install --save @react-native-vector-icons/common npm install --save @react-native-vector-icons/fontawesome npm install --save @react-native-vector-icons/fontawesome6 then cd ios && pod update

add code

import Icon from '@react-native-vector-icons/fontawesome';

......

    <SafeAreaView style={backgroundStyle}>
      <StatusBar
        barStyle={isDarkMode ? 'light-content' : 'dark-content'}
        backgroundColor={backgroundStyle.backgroundColor}
      />
      <ScrollView
        contentInsetAdjustmentBehavior="automatic"
        style={backgroundStyle}>
        <Header />
        <View
          style={{
            backgroundColor: isDarkMode ? Colors.black : Colors.white,
          }}>
          <Icon name="rocket" size={30} color="#900" />
        </View>
      </ScrollView>
    </SafeAreaView>

......

run

npx expo run:ios --scheme TestApp-tvOS --device "Apple TV"

but something went wrong in console [TestApp-tvOS] RNVI: failed to find font react-native-vector-icons/FontAwesome.ttf

image

PS: Tried replace fontawesome to fontawesome6 but get error

PS again: Tried main branch ,add Fonts and info.plist,but get error expofontloader error

[TestApp-tvOS] RNVI: failed to find font react-native-vector-icons/FontAwesome6_Regular.ttf
[TestApp-tvOS] RNVI: failed to find font react-native-vector-icons/FontAwesome6_Solid.ttf
[TestApp-tvOS] RNVI: failed to find font react-native-vector-icons/FontAwesome6_Brands.ttf

Reproducible Demo

Let us know how to reproduce the issue. Include a code sample, share a project, or share an app that reproduces the issue using https://snack.expo.io/. Please follow the guidelines for providing a MCVE: https://stackoverflow.com/help/mcve

stdiodavid commented 2 weeks ago

update: same error on ios

image
johnf commented 2 weeks ago

I'm not sure how I missed this in all my testing, but the fonts weren't in the font packages!

Fixed in latest release