Hi all
This is for a managed-workflow app using Expo SDK 35, on Android and iOS.
Our app is unable, according to Sentry, to download the following assets:
Error: Could not download from https://d1wp6m56sqw74a.cloudfront.net/~assets/5a293a273bee8d740a045d
https://d1wp6m56sqw74a.cloudfront.net/~assets/b2e0fc821c6886fb3940f8
https://d1wp6m56sqw74a.cloudfront.net/~assets/a37b0c01c0baf1888ca812
etc…
They’re all true-type font links. Now, we’re following the documentation very closely for this, and are using icons in the way mentioned, like so. It’s a component that shows a loading screen while all async assets are loaded. Once all the promises resolve, it redirects to either login or main app.
class AuthLoadingScreen extends Component {
componentDidMount() {
this._handleLoading();
}
// other lifecycle methods
_handleLoading = async() => {
await this._loadResourcesAsync();
// other async calls
}
_loadResourcesAsync = async() => {
const iconFonts = [
Icon.MaterialIcons.font,
Icon.Ionicons.font,
Icon.MaterialCommunityIcons.font,
];
const visuals = [
require('../assets/images/icon.png'),
// other images cut for brevity
];
const cacheIconFonts = iconFonts.map(f => Font.loadAsync(f));
const cacheVisuals = visuals.map(vis => Asset.fromModule(vis).downloadAsync());
return Promise.all([...cacheVisuals, cacheIconFonts]);
};
render() {
return (
<View style={styles.container}>
<ActivityIndicator size="large" color="#ffffff" />
</View>
);
}
}
export default connect(mapStateToProps, mapDispatchToProps)(AuthLoadingScreen);
However, it appears that certain fonts, or certain parts of the fonts, aren’t being bundled with the App? They’re all Expo vector icons from @expo/vector-icons": "^10.0.0"
, and no other special fonts are being loaded.
Do Expo fonts have to be explicitly set to be bundled somehow with an assetBundlePattern
in App.json? It seems strange to me to deep-link to a bundle pattern into node_modules. Please advise!
Thanks very much.