Mahmoud Abou-Eita
Mahmoud Abou-Eita

Reputation: 943

Android 4.0 PhoneGap issue

I have a PhoneGap application that works fine on v2.3 and earlier. However it's not working on ICS. the unknown Chromium error -6 appears and also it shows Failed loading some Sencha Touch files

06-20 14:19:54.006: E/Web Console(920): Uncaught Error: [Ext.Loader] Failed loading 'app/model/Category.js', please verify that the file exists at file:///android_asset/www/web/resources/scripts/sencha-touch-all.min.js:358

Although the activity has nothing but

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    super.loadUrl("file:///android_asset/www/web/index.html");
}

How to fix that?

Upvotes: 1

Views: 5348

Answers (2)

Nezam
Nezam

Reputation: 4132

Try to replace your code with this:

 public void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     super.init();
     super.loadUrl("file:///android_asset/www/web/index.html",10000);
    //super.setIntegerProperty("splashscreen", R.drawable.hdpi);

}

Upvotes: 2

Samuele Catuzzi
Samuele Catuzzi

Reputation: 710

I faced this problem yesterday and solved only after 11 hours of debugging & google.

The problem is caused by a bug in android 3.1+ that not parse correctly parameters of an url, this bug is better described here:

http://code.google.com/p/android/issues/detail?id=17535

for sencha application there is a simple workaround, put this two line of code in the beginning of your app.js file:

Ext.Loader.setConfig({disableCaching:false});
Ext.Ajax.setDisableCaching(false);

these lines will disable cache buster and thus the extra parameters that cause the bug :)

Upvotes: 2

Related Questions