0

私はアンドロイドに問題があります。 Androidのアセットディレクトリにあるファイルが見つかりません。ファイルを見つけることができません(Android)

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

null 

Unable to find file loading.js 

アニメーションファイルの場所: -

app/src/main/assets/loading.json 

コンポーネント: -

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> 
    ) 
    } 
} 

バージョン: -

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

明らかに、Android Studioでプロジェクトを閉じたり開いたりするだけで、正常に動作するようになりました。 –

+0

これは試してもうまくいかない:( – Lee

+0

あなたの問題がなぜ解決されたのか? – Lee

答えて

0

あなたはJavaScriptであなたのloading.jsonファイルを追加する必要がありますソースコードとそれを必要とする

<Animation 
    ref={animation => { this.animation = animation }} 
    style={StyleSheet.loading.animation} 
    loop 
    source={require('./loading.json')} 
    /> 
関連する問題