Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assets folder not loading in ionic app when custom hostname is specified in android 9.0 #368

Closed
mayur5478 opened this issue May 15, 2019 · 3 comments

Comments

@mayur5478
Copy link

mayur5478 commented May 15, 2019

If I try to load a js file which is located in assets/js/[myfile].js in index.html in ionic src folder , it tries to load that file from the custom hostname specified http://[hostname]/assets/js/[myfile].js rather than loading it from the local asset . This happens only when I install the webview plugin and in android 9.0 . It works in previous android versions.

@jcesarmobile
Copy link
Member

Can you provide an example?

@mayur5478
Copy link
Author

problem with a different js . Sorry for the inconvenience.

@th3hamm0r
Copy link

th3hamm0r commented Jan 30, 2020

@jcesarmobile I just stumbled across this issue, after changing the Hostname to fix the iOS cookie issue (#22).

If the hostname is set to "xyz.example.com" and the domain does not exist, everything works fine. If the domain is in use, the loading of all assets in android breaks, as for every asset the actual server is requested, not the local server. Note, it didn't help to change the scheme (default http) to something else, eg. "ionic".

My fix was to only configure the Hostname for the ios platform and leave the android defaults.
At the end there seems to be a bug on the android-side of the ionic plugin.

edit: I've reproduced the issue on two devices, one with Android 10, one with Android 6. This differs from the original poster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants