mcnamee / react-native-starter-kit

:rocket: A React Native boilerplate app to get you up and running very, very quickly :rocket:
MIT License
3.35k stars 863 forks source link

Error fontFamily Roboto on Android #129

Closed yopichy closed 6 years ago

yopichy commented 6 years ago

I have problem when running on android, running well on ios and web. Is this normal or i missing something?

error message :

console.error: "fontFamily 'Roboto_medium' is not a system font and has not been loaded through Expo.Font.loadAsync.

mcnamee commented 6 years ago

Hi there, I don't experience that one myself, but it looks to be an Expo and/or Native Base related issue.

Would you be able to look into those repos and let us know here, how you go?

yopichy commented 6 years ago

I just clone from this repository, and following instruction in readme doc. My friend has same problem with me. I think the issue came from expo, but you say don't experience issue like that. So if you have no problem, I should not too.

mcnamee commented 6 years ago

Hey @yovierayz You're right, thanks for raising the issue. When debugging locally (compared to viewing the public Expo version) the error appears. I've just pushed some code which removes the Roboto_medium font reference and resolves.

Can you have a quick test and let us know?

cidicles commented 6 years ago

This fixed it for me! Thanks!

yopichy commented 6 years ago

Hi @mcnamee , the issues has been gone! Thanks :)

achums007 commented 6 years ago

This worked for me .................

import React , { Component }from 'react'; import { Container, Header, Title, Content, Footer, FooterTab, Button, Left, Right, Body, Icon, Text, Root } from 'native-base'; import { Font , AppLoading} from 'expo';

export default class App extends React.Component {

constructor(props) { super(props); this.state = { loading: true }; }

async componentWillMount() { await Font.loadAsync({ Roboto: require("native-base/Fonts/Roboto.ttf"), Roboto_medium: require("native-base/Fonts/Roboto_medium.ttf") }); this.setState({ loading: false }); } render() { if (this.state.loading) { return (

   );
 }
 return (
   <Container>
     <Header backgroundColor="#fff">
       <Left>
         <Button transparent>
           <Icon name='menu' />
         </Button>
       </Left>
       <Body>
         <Title>Header</Title>
       </Body>
       <Right />
     </Header>
     <Content>
       <Text>
         This is Content Section
       </Text>
     </Content>
     <Footer>
       <FooterTab>
         <Button full>
           <Text>Footer</Text>
         </Button>
       </FooterTab>
     </Footer>
   </Container>
 );

}

}

YongzhaoZhang commented 6 years ago

This is because of Text in native-base , try to use Text in react-native.

kigawas commented 6 years ago

https://github.com/GeekyAnts/NativeBase/issues/1240

Here is a solution

TingFengJu commented 5 years ago

I got a solution. It is work for me. https://qiita.com/yusuke1111/items/c9d11a2a6cc1cefae728

DaggieBlanqx commented 5 years ago

GeekyAnts/NativeBase#1240

Here is a solution

After searching for tonnes of solutions , this worked for me , thank you

bearkfear commented 5 years ago

Hey, it's works for me. Just put a conditional if is loading and change to false when is done.

josepaez2 commented 5 years ago

Based on achums007 commented on 24 Apr 2018,

https://stackoverflow.com/questions/57066075/console-error-fontfamily-roboto-medium-is-not-a-system-font-and-has-not-been