0

android에 문제가 있습니다. 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

당신은 당신의 자바 스크립트에 loading.json 파일을 추가한다 소스 코드 및 필요

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