0

Ich habe ein Problem mit Android. Die Datei im Assets-Verzeichnis von Android wurde nicht gefunden.Ich kann die Datei nicht finden (Android)

Error :- 
Error while updating property 'sourceName' of a view managed by: LottieAnimationView 

null 

Unable to find file loading.js 

Animationsdatei: -

app/src/main/assets/loading.json 

Komponente: -

class Loading extends Component { 

    componentDidMount() { 
    this.animation.play() 
    } 

    render() { 
    return (
     <View style={StyleSheet.loading.page}> 
     <View style={StyleSheet.loading.animationWrapper}> 
      <Animation 
      ref={animation => { this.animation = animation }} 
      style={StyleSheet.loading.animation} 
      loop 
      source="loading.json" 
      /> 
     </View> 
     <Text style={StyleSheet.loading.text}>LOADING</Text> 
     </View> 
    ) 
    } 
} 

Versionen: -

"lottie-react-native": "2.2.0" 
"react-native": "0.47.2" 
+0

Scheinbar das Schließen/Wiedereröffnen des Projekts in Android Studio war genug, damit es richtig funktioniert. –

+0

Kein Glück mit dem Versuch, dies :( – Lee

+0

Eine Idee, warum Ihr Problem gelöst? – Lee

Antwort

0

sollten Sie Ihre loading.json Datei in Ihrem javascript Quellcode und erfordern es

<Animation 
    ref={animation => { this.animation = animation }} 
    style={StyleSheet.loading.animation} 
    loop 
    source={require('./loading.json')} 
    /> 
Verwandte Themen