Sencha Touch 2 and Phonegap: The connection to the server was unsuccessful error

Some Sencha Touch 2 and or Phonegap built App may suffer from this error at startup, depending on the amount of scripts loaded, the startup loop time, the performance of the current device or emulator, the lack of a splash screen.

Connection to server was unsuccessful. (file:///android_asset/www/index.html)

As workaround to fix the error you can adopt the following approach:

  1. Rename your App index.html to main.html
  2. Create a new index.html with the following content
  3. Rebuild your app and go!