Unable to create app: Error index.html not found

  • 4
  • Problem
  • Updated 5 years ago
App #356307

Working fine until I just tried to build again now and am getting "Unable to create app: Error index.html not found".

Any ideas?
Photo of Arron Bailiss

Arron Bailiss

  • 4 Posts
  • 0 Reply Likes

Posted 7 years ago

  • 4
Photo of HNSEIR

HNSEIR

  • 1 Post
  • 0 Reply Likes
I have the same problem.
Photo of Tal Cameron McMahon

Tal Cameron McMahon

  • 3 Posts
  • 0 Reply Likes
I have tweeted them, they say it is fine, but my tests show it is not.
Photo of Arron Bailiss

Arron Bailiss

  • 4 Posts
  • 0 Reply Likes
Still getting it now.
Photo of Ivan Marquez

Ivan Marquez

  • 4 Posts
  • 0 Reply Likes
Im getting same error too, even with old projects with any change :(...
Photo of ryan

ryan, Developer

  • 1538 Posts
  • 132 Reply Likes
Looking into this all, sorry for the inconvenience.
Photo of ryan

ryan, Developer

  • 1538 Posts
  • 132 Reply Likes
OK please upload your app again, and let us know if you still have issues.
Photo of Austin Wang

Austin Wang

  • 1 Post
  • 0 Reply Likes
appears to be fixed now. Thanks for the quick response!
Photo of Arron Bailiss

Arron Bailiss

  • 4 Posts
  • 0 Reply Likes
Fine now thanks - what was the problem?
Photo of Jens Peters

Jens Peters

  • 91 Posts
  • 1 Reply Like
The error is still there if using hydration!
Photo of ryan

ryan, Developer

  • 1538 Posts
  • 132 Reply Likes
If you're using Hydration, you'll need to completely rebuild the app, uninstall and reinstall on the device (not just do a hydration update).
Photo of Jens Peters

Jens Peters

  • 91 Posts
  • 1 Reply Like
Disabled hydration, still occurs with normal build. Uninstalled, reinstalled, nothing helps... not able to use PGB.

AppId: 192284
Photo of ryan

ryan, Developer

  • 1538 Posts
  • 132 Reply Likes
Jens, I just tested out your app, fine on iOS, on Android I'm seeing:

The connection to the server was unsuccessful. (file:///android_asset/www/index.html)

I'm assuming this is the issue you're referring to ... this is a very different issue. This thread is referring to a build error ... yours is a runtime error. The android logs show the following:

D/chromium(32106): Unknown chromium error: -6
D/CordovaLog(32106): Uncaught Error: Script error
D/CordovaLog(32106): http://requirejs.org/docs/errors.html#scripterror
E/Web Console(32106): Uncaught Error: Script error
E/Web Console(32106): http://requirejs.org/docs/errors.html#scripterror at file:///android_asset/www/js/main.js:73
I/ActivityManager( 389): Process com.android.packageinstaller (pid 31924) has died.
D/chromium(32106): Unknown chromium error: -6
D/chromium(32106): Unknown chromium error: -6
D/CordovaLog(32106): Uncaught Error: Script error
D/CordovaLog(32106): http://requirejs.org/docs/errors.html#scripterror
E/Web Console(32106): Uncaught Error: Script error
E/Web Console(32106): http://requirejs.org/docs/errors.html#scripterror at file:///android_asset/www/js/main.js:73
D/CordovaLog(32106): Uncaught Error: Script error
D/CordovaLog(32106): http://requirejs.org/docs/errors.html#scripterror
E/Web Console(32106): Uncaught Error: Script error
E/Web Console(32106): http://requirejs.org/docs/errors.html#scripterror at file:///android_asset/www/js/main.js:73
D/dalvikvm( 673): GC_CONCURRENT freed 471K, 7% free 9491K/10136K, paused 2ms+2ms, total 29ms
D/dalvikvm(31588): GC_CONCURRENT freed 509K, 6% free 9845K/10384K, paused 3ms+4ms, total 61ms
D/Finsky (31588): [1] 5.onFinished: Installation state replication succeeded.
I/JuiceDefender.Service( 2331): Schedule stop
D/Digital Clock(29977): Update broadcast received.
D/CordovaLog(32106): modules: storage
I/Web Console(32106): modules: storage at file:///android_asset/www/js/main.js:70
D/CordovaLog(32106): Uncaught Error: Load timeout for modules: storage
D/CordovaLog(32106): http://requirejs.org/docs/errors.html#timeout
E/Web Console(32106): Uncaught Error: Load timeout for modules: storage
E/Web Console(32106): http://requirejs.org/docs/errors.html#timeout at file:///android_asset/www/js/main.js:73
E/CordovaWebView(32106): CordovaWebView: TIMEOUT ERROR!
D/Cordova (32106): CordovaWebViewClient.onReceivedError: Error code=-6 Description=The connection to the server was unsuccessful. URL=file:///android_asset/www/index.html


I'll see what I can see.
Photo of Jens Peters

Jens Peters

  • 91 Posts
  • 1 Reply Like
But how could it be? working fine with local build on Android. And iOs is working? should be same behavoir in loading libs, as I am using requirejs. Maybe the path is wrong for Androig on PGB? Setted to /assets/www/ (see main.js)

Maybe the / before assets causing trouble when loading on Androig? For local build, it is located inside the /assets/www/js
Photo of ryan

ryan, Developer

  • 1538 Posts
  • 132 Reply Likes
Seems like things are timing out, try removing the following from index.html:

<script src="http://debug.phonegap.com/target/target-script-min.js#carnectmemobile"></script>

If you want to use debug.phonegap.com with apps from PhoneGap Build, you can enable Debug via the build settings, and we'll inject the script for you.

Also, any particular reason why you're loading the following scripts using absolute paths?

'pg' : '/assets/www/phonegap',
'fb' : '/assets/www/facebook-js-sdk',
'fbc' : '/assets/www/cdv-plugin-fb-connect',

This might work on Android, but won't work on iOS. Should be:

'pg' : 'phonegap',
'fb' : 'facebook-js-sdk',
'fbc' : 'cdv-plugin-fb-connect',


You should always load phonegap.js before any other scripts, including require.js. I might recommend removing 'phonegap' from main.js and adding it to index.html, before require.js:
<script src="phonegap.js"></script>.
Photo of Jens Peters

Jens Peters

  • 91 Posts
  • 1 Reply Like
Hey cool thank you for your help. I will remove the debugging stuff and use the setting for future.

The reason why I use absolute paths is, if they are not, requirejs looks into the defined appDir. But you are injecting the lib and plugins into root this is needed. So if using a slash in front of, require js will look outside.

I will try and update here as it is working correctly builded locally with requirejs loaded before pg.
Photo of ryan

ryan, Developer

  • 1538 Posts
  • 132 Reply Likes
Ah right OK well if those absolute paths are working for you, and you don't care if it doesn't work on iOS, then might as well leave it. But maybe this would work as well?

'pg' : '../../phonegap',
'fb' : '../../facebook-js-sdk',
'fbc' : '../../cdv-plugin-fb-connect',


debug.phonegap.com can be a useful tool, but it can also bog down your app and cause timeouts like this at times (we're working on this). Keep that in mind if you see further issues.
Photo of Jens Peters

Jens Peters

  • 91 Posts
  • 1 Reply Like
Ok maybe I have to switch to direct referencing, as it should work on iOs and Android.

It is a little bit annoying to have different behavior in here and cannot use the requirejs lazy loading (even if phongap supports this when building locally)
Photo of james leo

james leo

  • 1 Post
  • 0 Reply Likes
I am having the same problem. Can't upload my files at all. Is there any way I can fix this?
Photo of Arusha Imtiaz

Arusha Imtiaz

  • 4 Posts
  • 0 Reply Likes
Hi,

I started facing this problem with our app. Have tried all the solutions mentioned above. We were able to build it perfectly two days ago but now all of a sudden it started saying "index.html" not found.

Please fix it
Photo of Luke

Luke

  • 19 Posts
  • 0 Reply Likes
I'm getting this as well. I have a custom content src directory like the following:

When I run: cordova run android --device it works fine.

Is there anything that I'm not pushing to git by chance? I'm keeping hooks, plugins, www, and the files in the root like config, package.json, etc in GitHub.