-1

I'm trying to use a-frame in my Cordova android app but when I try to access other local files or https websites I get an error telling me I can't work from file://:

HTML file is currently being served via the file:// protocol. Assets, textures, and models WILL NOT WORK due to cross-origin policy! Please use a local or hosted server

My question is: how can I use a local server in my Cordova app? or are there any alternatives?

1 Answers1

0

Set a hostname to your app

 <preference name="hostname" value="com.myapp" />

So your content is served over https://com.myapp then you will load from https and not file:// anymore

Eric
  • 9,870
  • 14
  • 66
  • 102