I have the same issue in an ionic-v3 build and
<img src="assets/imgs/logo.png"> and
<div style="background-image: url('assets/imgs/logo.png')"></div>"-stuff. Also with background-images defined in the stylesheet.
Interestingly enough: similar stuff does not happen when creating a new project from the latest CLI version (4.1.1). My ionic-v3 project was created a few months ago with an older version.
Debugging showed that the newer version has a file named
$root/platforms/android/app/src/main/java/com/ionicframework/cordova/webview/IonicWebViewEngine.java, with other
The older version seems to simply use this:
In the IonicWebViewEngine there is e.g. this piece of code:
localServer = new WebViewLocalServer(cordova.getActivity(), "localhost:" + port, true, parser);
WebViewLocalServer.AssetHostingDetails ahd = localServer.hostAssets("www");
I cannot find a good equivalent in the old version as of yet. I’m still debugging my way through, though.
Any help as to why the older ionic-v3-version does not translate assets from using the file protocol to localhost correctly is appreciated.
@luigimassa Did you figure something out?