question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android] Local html file don't work on debug

See original GitHub issue

Works on core RN’s webview, but this package make this error:

TypeError: TypeError: TypeError: source is not an Object. (evaluating ‘‘method’ in source’)

with local file in source prop source={require('../index.html')}

But works correctly with url in source prop source={{uri: 'http://mysite.com' }}

Android Debug

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:17
  • Comments:12

github_iconTop GitHub Comments

2reactions
imran1992commented, Jul 27, 2019

Yes Same here. I need to render local HTML file with Javascript and assest in it. So for tempary fix i have to host that page on web and access it from there. But that solution is so slow rendering… 😦

1reaction
Youssef-Tarek-Tewfikcommented, Sep 23, 2019

@luckcoding I tried the same but it’s showing an ERR_FILE_NOT_FOUND. I did place my html file under android/app/src/main/assets/ and I had the following done too: allowFileAccess={true} domStorageEnabled={true} javaScriptEnabled={true} Currently, I’m forced to keep loading my htmls statically, copying and pasting after every change (which is really painful)

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Android] Local html file don't work on debug #549 - GitHub
I need to render local HTML file with Javascript and assest in it. So for tempary fix i have to host that page...
Read more >
Loading Local Files on Android With Local HTML - net
I've always placed my files in the android 'assets' folder. Then, you can do something like this for the HTML: webView.
Read more >
Why can't Chrome read a local HTML file on Android? - Quora
The most common reason for seeing HTML in the browser is the Content-Type header sent by the web server. · You can inspect...
Read more >
Open local html file on android - Mozilla Support
It works on Opera. 2) If I go to a file manager, select an html file, and click "Open with", firefox doesn't show...
Read more >
Loading in-app content - Android Developers
Your app may need to load a mix of in-app content and content from the internet, such as an in-app HTML page styled...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found