React Native Android cannot load html file from local

Viewed 659

I would like to load a local html file in my React Native App. Its works in IOS but failed in Android. Here I my code:-

 <WebView
          originWhitelist={['*']}
          source={Platform.OS === 'android' ? { uri: 'file:///android_asset/index.html' } : require('../screens/index.html')}
          startInLoadingState={true}
          />

Here is my local html file path.

enter image description here

I have no idea where should I configure in order to get it works...Please help. Thank you.

1 Answers

Code is working. Remember to restart your react server everytime you change in android folder

Related