React Native WebView "xml file does not appear to have any style information" Error


I’m trying to include an HTML file in a React Native WebView. The GitHub repo containing the full project is located here: To summarize, the WebView shows the correct file using the XDE’s “Share” functionality. However, it displays the following error when published: “This XML file does not appear to have any style information associated with it”

The project works when “Shared” via the Expo XDE and renders the HTML file correctly as shown below:

However, when the project is published via the XDE’s “Publish” button, I get the following ““xml file does not appear to have any style information”” error shown below:

I have the following lines in my app.json file to ensure that the HTML file the WebView is trying to access is included in the published bundle. Note that I specifically included the HTML file to ensure it was included. I received :

"packagerOpts": {
      "assetExts": ["html"]
    "assetBundlePatterns": [

The HTML file is just a simple attempt to render some text:

<!DOCTYPE html>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width,initial-scale=1">
    <body style="
    margin: 0 !important;
    padding: 0 !important;
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        <h2>JavaScript in Body 123</h2>
        <div id="p1">test area</div>

The HTML file is included in the application by via a require statement:
const INDEX_FILE = require("./assets/dist/test.html");

Finally, the WebView component looks like this:

		backgroundColor: '#ffebba',
		padding: 10

This project is an attempt to create a simple proof of concept project to diagnose and solve issues mentioned in a previous Expo Forum post: here


@reggie3 I also have the same issue with webview :frowning: Did you find a solution to your problem?


@maks171293 Nope, not yet. I’m still looking though, and will post if I find anything.

As an information point. I was ale to confirm that iOS reports a similar “AccessDeniedAccess” error followed by a long hash code.


@maks171293 I finally figured it out :grin:
Expo was looking for the file in the wrong location. If you use the XDE you can see that Expo is looking for the index file in the wrong location. In my case it was looking for the file in an “assets/assets” path.
This is what was displayed by the XDE:

5:54:56 PM
::ffff: - - [24/Mar/2018:21:54:53 +0000] "GET /favicon.ico HTTP/1.1" 404 24 "" "Mozilla/5.0 (Linux; Android 7.1.1; Nexus 6 Build/N6F27M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/65.0.3325.109 Mobile Safari/537.36"
5:55:37 PM
Building JavaScript bundle: finished in 548001ms.
5:55:37 PM
Unable to resolve ./dist/index.html" from "./C:\\Users\\regin\\Dropbox\\Expo Projects\\react-native-webview-leaflet\\WebViewLeaflet.js`: The module `./dist/index.html` could not be found"

This was with the following in my app.json file

"packagerOpts": {
      "assetExts": ["html"]
    "assetBundlePatterns": [

I’m now able to successfully access the index.html file and run its inlined JavaScript by creating a directory called “assets” in the already existing “assets” directory, and saving index.html in there.


Continuing to update in case anybody else comes across this.
Attempting to use an NPM package containing a component that uses the above method results in an even more problematic path that the WebView is attempts to load its HTML file from as shown below:

::ffff: - - [25/Mar/2018:16:11:44 +0000] "GET /favicon.ico HTTP/1.1" 404 24 "" "Mozilla/5.0 (Linux; Android 7.1.1; Nexus 6 Build/N6F27M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/65.0.3325.109 Mobile Safari/537.36"

I think I could get it to work if there was a way to remove that first “assets” from the HTTP address. It has popped up whenever I attempt to provide a source for the WebView. The problem appears to be that something is designed to expect content from the assets directory and that’s automatically where Expo looks for it.

closed #6

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.