Webview is not loading resources

I am building an app that uses a Webview. The webview loads an index.html page that is located in the assets folder. The index.html loads resources such as CSS and JS files. The resources are located in subfolders (js, css, …). The resources are referenced with relative paths. This works fine in the companion. But when I build and install the APK in my S22 running Android 16, the resources (CSS, JS, …) don’t load. This seems to happen since Release nb206. With previous version it was working fine.

The URL I set in the webviewer is https://localhost/index.html. It seems to be the recommended way to do it. I also tried file:///android_asset/index.html, but it doesn’t work.
I tried to add the WebViewExtra extension, but it doesn’t help in this case.

Has anyone an idea what to do?

Thanks for your help,

Greg

No sub folders in the assets.
Keep everything as a flat file structure there.

Alternatively, download everything to your ASD on first run and call your index.html from there
file:///.../index.html

If you must have the file structure in the assets. Don't put any thing in the assets, then compile the app. Decompile the app and add your file structure to the correct place. Recompile your app.

Thank you TIMAI2,

It works fine now I moved every file at the same level.

1 Like

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