Expo use-font not working after expo publish

812 views Asked by At

App font is working fine on all platforms before publishing.

Once the app is published, expo publish, font is just not showing.

I have added the font through Xcode. Like that.

Font is added to the app following expo's instructions

Checked, rechecked and reinstalled the yarn package seem to exist (checked by showing some text on screen). Added the package using yarn add 'use-expo/font'

This is how the font is loaded:

import { useFonts } from "@use-expo/font";

export default function App() {
  let [fontsLoaded] = useFonts({
    Rayando: require("./assets/fonts/crayonsRegular.ttf"),
  });

  return (
    <>
     {fontsLoaded && <Text style={[styles.answerText, {fontFamily: "Rayando"}]}>{number ? 1 : 0}</Text>}
    </>)
}

Any advice on how resolve this issue, am I missing something?

Using latest version of expo (37.0.0) expo-cli and yarn.

1

There are 1 answers

0
Diyorbek Sadullaev On

I was also running into a similar problem. As far as I understood expo publish does not behave as expected in ejected projects: the app loads assets differently.

Found out about this in here.

The suggested solution is running expo publish --target managed or, as of my case, deleting ios and android folders to convert bare project to expo-managed.