jeyanthinath jeyanthinath - 5 years ago 199
HTML Question

Default Cordova index.html is compiling

I have cordova latest version installed on my system and I created the basic app with command

cordova create


and I added the platform using

cordova add platform android


and I replaced the default index.html in the www directory with my own index.html

but whenever i tried to generate apk, and tried to run it on my mobile. It was the apk generate with default index.html

the screen of my app will be

App with Default index.html even with my own index.html

How to resolve this issue ?

Answer Source

This is a normal behaviour.

Cordova is going to take the index.html from your projects root folder, everytime you run cordova build, prepare or serve without attribues, which is located directly inside your projects www folder.

Root www folder inside your cordova project contains the index.html which is taken and "thrown" into all platform folders when you run those commands.

projectName -> www -> index.html


Solution

  1. You work in your projects root folder, and run cordova prepare everytime after you did a change to your index.html file.
  2. You work directly inside your android project folder and the index.html which is located inside the assets -> www folder
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download