Я пытаюсь использовать изображение Unable в ресурсах с последующей предварительной загрузкой и активами кэширования, но оно показывает эту ошибку:
Невозможно разрешить ../assets/image.png
Я уже установил expo-актив в свой проект, и мой образ уже остается в активах в виде JPG и PNG, но он по-прежнему ничего не делает.
import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import firebase from 'firebase'
import { Asset } from 'expo-asset';
import { AppLoading } from 'expo';
import MusicApp from './App/index';
function cacheImages(images) {
return images.map(image => {
if (typeof image === 'string') {
return Image.prefetch(image);
} else {
return Asset.fromModule(image).downloadAsync();
}
}); } export default class RegisterScreen extends Component {
static navigationOptions = {
header: null
}
constructor() {
super();
this.state = {
isReady: false
};
}
async _loadAssetsAsync() {
const imageAssets = cacheImages([require('./assets/LUMO-logo.jpg')]);
await Promise.all([...imageAssets]);
}
render(){
if(!this.state.isReady){
return(
<AppLoading
startAsync={this._loadAssetsAsync}
onFinish={() => this.setState({ isReady: true })}
onError={console.warn}
/>
);
}
return <MusicApp />;
} } const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
Может кто-нибудь, пожалуйста, помогите мне.