我正在使用 React-Native 创建一个项目,目前当我尝试编译我的代码时,我收到一条错误消息undefined is not an object (evaluating '_expo_.Asset.loadAsync')
我不完全确定是什么原因造成的,因为我在编译项目之前输入了很多代码。但是,从我收集的内容来看,这可能与我正在导入的字体有关?
目前这是我的代码导入字体的样子。
async componentDidMount() {
await cacheFonts({
georgia: require('../assets/fonts/Georgia.ttf'),
regular: require('../assets/fonts/Montserrat-Regular.ttf'),
light: require('../assets/fonts/Montserrat-Light.ttf'),
});
this.setState({ fontLoaded: true });
}