Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Expo use-font not working after expo publish

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.

like image 671
Idan Avatar asked Nov 06 '22 08:11

Idan


1 Answers

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.

like image 187
Diyorbek Sadullaev Avatar answered Nov 15 '22 12:11

Diyorbek Sadullaev